Cellular Automaton Traffic Simulation

University of Delaware, Dept. of Civil Engineering


  1. Running the Simulator
  2. About the Simulator
  3. Requirements to Run the Simulator
  4. How to Clear the Java Classloader Cache
  5. Links to Original Code
  6. Contact

Running the Simulator

About the Simulator

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:

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 Nagel-Schreckenberg rules:

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.

Requirements to Run the Simulator

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.

How to Clear the Java Classloader Cache

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 following:

Now you can visit or reload simulator page and be sure you're seeing the most recent version.

Links to Original Code

Caution: The following use deprecated Java Thread code that can cause your browser to hang.


Feel free to contact us at

Professor Shinya Kikuchi, kikuchi@ce.udel.edu
Professor Jong Ho Rhee, jhrhee@ce.udel.edu
Dr Michael Markowski, mm@udel.edu