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
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.
files (which is optional) requires a SAX parser. If you do not
already have a parser installed you can download one free via
See "LandXML Trouble-shooting" in the (im/Ex)port panel help for all
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:
See the "3D Display Trouble-shooting" section of the "3D proJection
panel" help in the "help / index" panel for more installation
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
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
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
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
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
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
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;
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
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
mapTraff (CHart.java) contains keyBuddy (a KeyAdapter) class which
uses reflection to simplify translation of the ENTER and ESCAPE keys
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
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
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.
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.