Now with language import and export function
for panel text, error messages and help files.
(Spanish available - Espanol050900.zip)
Asymptotically approaching usability since 2003!
See the Requirements section for the
Java3D requirements.
miniTraff animates a user created map of streets and intersections.
Vehicles move along the streets
controlled by the signals within
the intersections.
miniTraff allows traffic engineers and students to model designs
for traffic layouts and test timing schemes (including semi-actuation
and density) for efficacy.
miniTraff has the following System Requirements:
The (required) unzipped Jar files require about 1 MB of disk space.
The (recommended) unzipped Map files require about 2.5 MB of disk space.
The (optional) unzipped Source files require about 2.2 MB of disk space.
The (optional) unzipped Javadoc requires about 4 MB of disk space.
The (optional) unzipped Espanol files require about 500 KB of disk space.
These programs require the Java Runtime Environment (JRE) version 1.5
(or higher). You can download the JRE free from
Sun or
Apple (OS X
requires Java 1.6). You don't need the JDK (Java Development Kit)
or anything else to run miniTraff with the 2D display.
The miniTraff 2D display runs a bit slow on a Pentium at 233MHz, but it
still works fine if you have less than a dozen intersections on your
map. The (optional) 3D display needs at least a 1GHz processor with
256MB of RAM and a fairly beefy video card and still
may not display smoothly if run faster than real time.
Importing LandXML
files (which is optional) requires a SAX parser. If you do not
already have a parser installed you can download one free via
www.saxproject.org.
See "LandXML Trouble-shooting" in the (im/Ex)port panel help for all
the dirt.
The (optional) 3D display
requires drivers for JAVA 3D, VERSION 1.5.1, which can be downloaded free through: java.sun.com
The 3D display may also require drivers for OpenGL version 1.2 or higher.
These can be downloaded free through:
www.opengl.org
See the "3D Display Trouble-shooting" section of the "3D proJection
panel" help in the "help / index" panel for more installation
troubleshooting details.
I've attempted to test this as well as possible, but my test platforms
are Linux (Debian w/ a 3.0 kernel and Fluxbox) and Windows ME,
so other platforms may have problems. (and more testing is always
needed)
adjustable initial offset (for synchronization) by intersection;
adjustable green and yellow intervals by phase;
adjustable red clearance by Barrier;
stop or yield signs (two way, four way or more);
adjustable 'minimum stop time' by leg (for stop or yield);
selectable permissive left (or right for Right-hand
drive);
selectable right on red (or left, ditto for rest of
this page).
Worldly map design features:
supports either Right or Left-hand drive;
recall, resting and demand actuation, with
loops any distance from the stop bar (up to the length
of the street);
adjustable intersection radius (stop bar to center);
billions of streets and intersections
(if you have enough memory);
streets of any length (up to 32,700 meters or yards)
and direction with multiple lanes;
street lengths can be entered in yards (meters) or
seconds (seconds are used internally);
speed limit, direction, grade or number of lanes
can change at any point within a street
(streets are composed of multiple contiguous street fragments);
multiple selectable right, left or 'U' turn destination
streets with adjustable turning counts or turn percentages;
any number of thru, right and left (shared or exclusive
turn) lanes;
(any number is Almost New)
multiple adjustable right and left turn lane lengths and
adjustable lane usage percentages for all lanes with
multiple percentages for shared turn lanes.
Convenient map assembly and maintenance features:
Signals can be 'timed' automatically for both capacity
and tolerable synchronization;
"Add Turns" and "Toggle Lights" for an entire
intersection automatically;
select automatic creation of shared or exclusive turns;
turn percents update automatically when a street,
fragment or intersection leg is deleted;
thru and turn phases automatically disabled when the
associated destination street is not available;
select vehicles from the 2D display using the mouse and
change their location, speed, turn preference, etc.;
run traffic simulation logarithmically slower or faster, or
run traffic simulation in 'real time' and
reset time, traffic and lights to zero.
Thoughtful usability features:
import and export all error messages, panel text and
help files for translation to various languages.
(example Spanish language module available - Espanol##@@%%.zip)
(New)
help dialogs for every panel;
help text can be searched locally or globally;
a help 'index' panel providing direct access to every help panel;
selectable font style and size;
selectable 'pop-up Message level' (Guru, Regular or Newbe);
I believe that a healthy user community can help me to
improve the existing code and plan new extensions.
miniTraff uses several advanced features in Java and
can serve as an example for others who are learning Java.
The main() method checks for a trailing 'Carriage Return'
parameter, so that it can be called from the same script (batch file)
in both Linux and Windows systems;
Source download includes a build.xml file so that
it can be compiled with Apache Ant;
Source download includes JUnit test files which
are automatically run by Apache Ant;
Reflection (dynamic method selection and execution, used heavily
by queries);
Subclassing FilenameFilter interface to extend functionality;
Keyboard post processing (and construction of key events);
Use of KeyListener for keyboard control of scrolling panels;
GridBagLayout, CardLayout and most other layouts;
Reading and writing serialized objects (to save and restore the
traffic data);
Reading and writing text (using split() to tokenize data);
Reading 'Column Separated Values' (in an *.CSV file) where the
existence and order of columns is not guaranteed;
Reading text files and JPEGs
(including reading text help files that are stored inside the Jar file);
Use of a SAX Parser for importing the
LandXML data;
Use of SimpleDateFormat for custom date creation;
Use of 'generics' for type safe collections (Vector and ArrayList);
Use of 'WeakReference' to aid garbage collection;
Declaring 'Behavior' as an Object so that Java3D isn't required by Jar;
Use of StringBuffer and StringBuilder for String creation;
Reasonably complete javadoc for all visible (public) objects and
methods;
Dynamically created multiple threads (up to 13 with
queries - things
slow down a bit);
A double buffered 2D display
(with multiple methods updating the buffers);
A 3D point object (DPoint3) for manipulating both map and real
world coordinates (including zoom, scroll and 3D tilt);
Creation of a static map and moving vehicles using
Java3D;
Transparent (alpha = 0) 2D map colors;
A half transparent half opaque BufferedImage for fragment end caps;
Dynamic (and complementary) foreground and background colors on
the UColors "OK" button;
Use of Robot.createScreenCapture() for Screen Print creation;
(Almost New)
Playing dynamically created sounds (using PCM encoding);
An internal method within the 2D map display that creates a Pop-up
menu with a right mouse click or selects a vehicle with a left mouse
click;
Simple dynamic informational displays on that Pop-up menu;
An overloaded display dialog (UPrint) which is used for error
messages, the query displays
and quick debugging. and
mapTraff contains a mouSelect method which can select the points
and lines drawn on the Canvas using the 'Rectangle.contains()' Shape
Interface;
mapTraff (CHart.java) contains keyBuddy (a KeyAdapter) class which
uses reflection to simplify translation of the ENTER and ESCAPE keys
by Dialogs;
mapTraff contains a modal dialog (CName.java, used when
complementing streets) which creates a modal help dialog (so that
the input to the help dialog is not blocked);
mapTraff re-uses the miniTraff CardLayout() panels GXport, GValues
and GLeg, as dialogs and adds help and cancel buttons.
The Version naming convention is as follows:
I use a six digit Version/Release/Modification number,
so ##@@%% translates into Version ## Release @@ Modification %%
A Version change signifies either a change to the
underlying form or function of the program, or the need to get the
release numbers down to a manageable amount;
A Release change adds new features to the product. This usually
invalidates old *.trf files (miniTraff's storage format);
A Modification is a minor bug-fix or an aesthetic change (like
standardizing my endemic spelling).
To download the program, read the paragraph below, then go
here.
You want 'Jar##@@%%.zip'. (where ##@@%% is the
current Version number) You probably also want
'Maps##@@%%.zip', which contains exported [*.mtf and
*.xml format] example maps. They may not be the same version level,
this is OK. The 'Espanol##@@%%.zip' file is only
useful if you speak Spanish. You don't need
"Source##@@%%.zip" or "Javadoc##@@%%.zip" to run the programs (and you
really don't want them unless you are a programmer). I strongly
recommend reading (and downloading) the 'Release
Notes' file for 'Jar##@@%%.zip'. Any other
files are (older) copies of these four.
Quick start Instructions for the Jar download (more in the
Release Notes)
If this is not your first download, use the Export
"Backup Cities" button to create *.mtf format files. Put these files
somewhere safe. You can import these files when you can not read
*.tfc files that were created in previous versions.
Unzip the Jar##@@%%.zip file.
This will create a 'miniTraff' directory which will make cleanup
easier if you decide this was a waste of time. You can also
run miniTraff or mapTraff from a floppy disk.
Unzip the Maps##@@%%.zip file. (if you have it)
The zip files can be deleted now - optional.
mapTraff only
Run the 2cjrun.bat file to start mapTraff.
Change and save the citY-wide (CTRL-Y) Default Values.
Select the Help menu and read the "Mapping Tutorial".
Run traffic (make the lights change and the vehicles move CTRL-R)
Gaze in wonder for a while...
Kill traffic (stop it from running CTRL-K) - optional
Hide the map and signals (CTRL-H) - optional
Quit the program entirely (CTRL-Q) - works at any time
miniTraff mouse use:
When the 2D map display has covered the
main menu, a right click will open a pop-up menu and
a left click will stop traffic and may select a vehicle.
CTRL-/ will bring up a panel specific help screen for the current display.
mapTraff mouse use:
A left click will either open a pop-up selection menu or the creation
menu (if nothing is selected).
A right click will always open a pop-up creation menu.
CTRL-/ will bring up the mapTraff general help screen.
Copyright (C) 2003-2012 by Ralph L. DeCarli. All rights reserved.
miniTraff and mapTraff are licensed under the Open Software
License version 1.1. This software is provided under this License on
an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied,
including, without limitation, the warranties of NON-INFRINGEMENT,
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.