mapTraff now with a Query Halt and Semi-Auto-Export-Backup!
(whatever that means)
Asymptotically approaching usability since 2003!
miniTraff simulates 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 efficiency.
These programs require the Java Runtime Environment (JRE) version 1.5
(or higher). You can download the JRE free from
Sun (or
Apple if You're
using OS X). You don't need the JDK (Java Development Kit) or anything else.
Importing LandXML
files will require 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.
I've attempted to test it as well as possible, but my test platforms
are Linux (Debian w/ a 2.6.21 kernel and Fluxbox) and Windows ME,
so other platforms may have problems. (and more testing is always
needed)
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 (use of StringTokenizer and split());
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 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 display
(with multiple methods updating the buffers);
transparent (alpha = 0) map colors;
a half transparent half opaque BufferedImage for fragment end caps;
Dynamic (and complementary) foreground and background colors on
the UColors "OK" button;
Playing dynamically created sounds (using PCM encoding);
An internal method within the display that creates a Pop-up menu
with a right mouse click;
UPrint, An overloaded display dialog 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;
mapTraff (CHart.java) contains a keyBuddy (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 naming convention for releases 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 the 'jar' file. You probably also want the
'Maps' file, which contains exported [*.mtf and *.xml
format] example maps. They may not be the same version level, this is OK.
You don't need the Source or the Javadoc to run the
programs (and you really don't want them unless you are a programmer).
I strongly recommend reading (and downloading) the
'Notes' file that accompanies the
'jar' file (the icon looks like a tiny clipboard).
Quick start Instructions for the JAR 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 miniTraff##@@%%.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.
The zip file 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.
Bring up the help panel (CTRL-/) and read the "Mapping Tutorial".
Create a map and save it.
miniTraff only
Run the 1jarun.bat file to start miniTraff
Display the map and signals (CTRL-V)
Run traffic (make the lights change and the vehicles move CTRL-R)
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 map display
has covered the main menu, a left click will close the display and a
right click will open a pop-up menu. CTRL-/ will bring up a panel
specific help screen for the current display.
mapTraff mouse use:
A left click may open a pop-up selection
menu (or an error
message if nothing is selected). A right click will open a pop-up
creation menu. CTRL-/ will bring up the mapTraff general help screen.
Copyright (C) 2003-2008 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.