Cellular Automaton Traffic Simulation
- General version. The
simulator demonstrates nearly symmetric lane changing, allows speed limit
and also allows the user to construct barriers. Barriers allow simulation
of road construction, accidents, on-ramps, off-ramps, merging, etc. This
is described in more detail on that page.
Vehicles are color coded by destination.
- We also have several special purpose simulators:
- Speed control. A study of how and when
speed controls help merging situations.
- Interstate Hwy. A study of congestion at a
geometrically complex area of an interstate highway.
- ETC (EZ-pass). A study of where to place
ETC tollbooths in a toll plaza.
- Lane changing only.
This is a version of the simulator that does not support barriers.
It is interesting because vehicles are color coded by lane of origin, and
so lane changing can be more easily observed.
The goal of our work on this simulator is to model weaving, merging,
entering, and so on on single and multi lane roads. The core of
the simulator is a cellular automaton, or CA, for short. Our work is
based on the CA developed by Nagel and Schreckenberg, which is
composed of three simple rules described below. The simulator itself
is written in Java. We gratefully acknowledge the work done at the Universität
Duisburg by B. Eisenblätter, L. Neubert, and J. Wahle, who wrote
in Java a one and two lane simulator of the Nagel-Schreckenberg
cellular automaton model. We saved much time by using their code which
is generously available for downloading.
Using their code as a starting point, we rewrote much of it, and
further modified it so that it would better suit our goals. The original
Duisburg code models a closed system where a set number of vehicles
traverse a loop. In their two lane case, lane changing follows "Autobahn
rules," meaning that a vehicle can only overtake on the left. To date,
these are the modifications we have made:
- Converted model to an open system. New arrivals enter (are created)
at the beginning of the the road, and vehicles reaching the end leave
- Lane changing rules are nearly symmetric. Vehicles may pass on the
left or right, but there is a preference for overtaking on the left.
- Any number of lanes may be simulated (arbitrarily limited to 4 at
- Each vehicle is a Java object allowing us to give each some
individuality such as color, travel goal (for weaving), its
own maximum speed, etc.
- The CA considers not only speed of the vehicles, but the max allowable
speed on each cell of the roadway.
- Vehicles have destinations when the road diverges to two or more
- Vehicles slow down as they approach the point of divergence if they are
in the wrong lane.
- As vehicles approach point of divergence they are more likely to change
lanes towards the correct lane.
We have also added a simple GUI flexibly permitting creation of many
road types. The user clicks and drags the mouse cursor highlighting a
rectangular area of interest on the roadway. A menu pops up permitting
the user to either modify the maximum allowable speed within that
rectangle (to simulate, for instance, a crest or sag) or erect barriers.
Barriers can be erected on any or all of highlighted rectangles left,
right, top, or bottom sides. A small, rectangular barrier might represent
a portion of the roadway blocked due to work, accident, etc. Similarly, a
barrier along just the top or bottom of a highlight rectangle can be used
to simulate merging roadways. To simulate an on-ramp, the rightmost lane,
assuming left-to-right travel of vehicles, could have its rightmost
portion blocked off with a long rectangular barrier. Its leftmost portion
would have a barrier just between the rightmost lane and the lane
immediately to its left. The center section of the roadway would have no
barriers, and is the area where merging would occur.
To picture the workings of the CA, imagine a one lane road represented
as an array of integers. Each cell of the array can hold at most one
vehicle. More correctly, each cell holds the current speed of a
vehicle. Speed in this context means how many consecutive array cells the
vehicle will traverse at the next time step of the simulation. So if a
single vehicle were on the "road" and going at a speed of, say, 5 cells
per time step, it might first appear at cell 1, and at each successive
time step would them move to cells 6, 11, 16, and so on until it traveled
beyond the array's bounds. With other vehicles on the road, speeds and
positions are adjusted using slightly modified versions of these original
where v is a vehicle's speed and p is the vehicle's position
in the array. GapAhead is the number of empty cells ahead of the
vehicle. Our minor modifications take into account that a road cell might
have a unique maximum speed and that the vehicle, as well, may have its own
self-imposed maximum speed.
- Acceleration: v = Min(v+1, vmax, gapAhead)
- Deceleration: With probability P, v = Max(v-1, 0)
- Speed: p = p + v
Because the simulator code uses some of the more recent additions to the
Java language, the simulator can only be run using an up-to-date
Java Development Kit (JDK 1.3 or newer) or by using Netscape 6 or newer. Go
to www.netscape.com to download
Netscape 6. Once installed, when you go to the simulator URL given at
the top of this page, you may be prompted to download the Java plugin.
After following the directions for doing so, quit the browser, restart
Netscape 6 and then visit the simulator URL.
As our simulator code evolves and improves, Netscape will unfortunately
continue to use your previously cached version of the code. To be sure
you're seeing the most recent edition of the software, please do the
- Start Netscape 6
- Start the Java Console (Click on Tasks, Tools, Java Console.)
- In the Java Console window, click on the Clear button once or
then type the letter x to clear the classloader cache.
- Finally, click on the Close button to get rid of the window.
Now you can visit or reload simulator page and be sure you're seeing
the most recent version.
Caution: The following use deprecated Java Thread code that can cause
your browser to hang.
Feel free to contact us at
Professor Shinya Kikuchi,
Professor Jong Ho Rhee,
Dr Michael Markowski,