This page was automatically generated by NetLogo 3.0. Questions, problems? Contact feedback@ccl.northwestern.edu.

The applet requires Java 1.4.1 or higher. It will not run on Windows 95 or Mac OS 8 or 9. Mac users must have OS X 10.2.6 or higher and use a browser that supports Java 1.4. (Safari works, IE does not. Mac OS X comes with Safari. Open Safari and set it as your default web browser under Safari/Preferences/General.) On other operating systems, you may obtain the latest Java plugin from Sun's Java site.


created with NetLogo

view/download model file: sot-2006-07-01-1930.nlogo

WHAT IS IT?
-----------
This model shows how a little bit of lawlessness can actually allow traffic at a malfunctioning intersection to flow smoothly.

The model was inspired by a real-life incident at a 3-way T-shaped intersection in New Delhi, India, where the lights were malfunctioning. The signals for two directions were frozen in the Red state, while the signal for the third direction was frozen in the Green state.

HOW IT WORKS
------------
There are cars coming from three directions, Blue cars from the South, Red cars from the West, and Green cars from the East. (Note: The original intersection was a 180 degree rotated version of this simulation - i.e. South was North, and East and West were interchanged)

Each direction of traffic has two lanes, but only one lane is simulated in this model for reasons of speed and simplicity. This is a reasonable simplification because the other lanes do not interfere with other traffic flows.

Each square patch has a side of about 2.5m and can be empty or occupied by exactly 1 car. The model explicitly forbids collisions or overtaking. All cars try to move to the patch ahead on each time-step, and remain where they are if the patch ahead is occupied or if the traffic signal prevents them from moving. Thus the velocity of the car is either 1 or 0 patches/time-step.

New cars are created at the edge of the view with a frequency depending on the value of the car-density slider.

While a car is stopped (whether at a traffic light or because of a car in front), its wait-time counter increases by 1 every time-step.

At a traffic light:
- If a car comes to a green light, it keeps moving into the intersection.
- If a car comes to a red light, it stops. The wait-time counter of a stopped car at a red light will keep increasing with every time-step, and if the wait-time eventually exceed its wait-time limit, then the car moves into the intersection. This impatience and lawlessness is the key to this model and allows several phenomena to emerge, including the smooth flow of traffic through the intersection.

However, in both cases above, a car at a traffic light about to enter the intersection will not do so if there are more than 6 cars already in the intersection area. (The interesection area includes the middle space, as well as the patches with the traffic light). Without this restriction, all traffic gets gridlocked immediately.


HOW TO USE IT
-------------
To use this model, first set the parameters using the sliders on the left, and then click the Setup button. The following values are selected by default:

- car-density: 1.0

- signal-cycle-time: 60 (Only needed in the case of functioning traffic lights)

- wait-time-limit: 80 (the time after which a waiting car loses patience and crosses the intersection)

- plot-window: 20 (number of time steps after which the Car throughput plot is updated)

- signal-combo: "Normal" (Change this to "All green" to see how traffic can gridlock if allowed to have its own way, and then change it to "S-green, rest red" to see how impatience and lawlessness allows traffic to flow smoothly, only rarely resulting in gridlock)

Click "Run Forever" and watch the simulation.
You might need to click "Run one step" a few times if the simulation stops with no cars being created when traffic density is very low, because the Run Forever button is programmed to stop when no cars are moving in the system.
If the traffic gridlocks, click Setup to restart the simulation.


THINGS TO NOTICE
----------------
The plot on the right shows the throughput of cars per time-step, as measured by the number of cars leaving the intersection over several time-steps (the denominator is controlled by the plot-window slider)

As there are three directions, the theoretical maximum throughput is three cars per time-step but this limit is never reached because it would imply that all cars move through the intersection at the same time, which is impossible as collisions are not allowed and no patch can have more than one car at a time.

The red, green, and blue plots represent cars from the West, East and South respectively, while the gray plot represents their sum, or the total flow rate through the intersection.

Set signal-combo to "Normal"
Observe how the three directions have effectively identical rates.
Set the plot-window to about 20 to see how the three take turns peaking - which is to be expected since at any one time only one direction is allowed to move through the intersection.

Set signal-combo to "All green"
Observe how the three directions have effectively identical rates (until the system gridlocks)

Set signal-combo to "S-green, rest red"
Observe how blue (S) has a higher throughput. More interestingly, set the plot-window to a smaller number like 10 or 20 and observe how the red (W) and green (E) plots seem to oscillate, with each direction peaking in turn, similar to the way the three directions peak in turn in the "Normal" scenario.

Change wait time to a lower value and observe how gridlock happens more often, until at wait-time = 0 when the system becomes equivalent to the "All green" signal-combo.

Set signal-combo to "All red"
Again, gridlock hardly ever happens. Observe how the three directions have the same throughput curves initially (because they start

Set signal-combo to "Stop rule" to simulate the international stop rule, where each car stops at the stop sign and waits for cars to leave the intersection, and moves into the intersection in the order in which cars arrived at the intersection.
Observe how the three plots have nearly equal throughputs.


THINGS TO TRY
-------------
See if gridlock happens in the "All green" signal-combo even if the car-density is reduced

See how increasing the plot window to its maximum setting affects the plots.

See how many ticks it takes for the traffic to gridlock in the "All green" signal-combo


RELATED MODELS
--------------
http://ccl.northwestern.edu/netlogo/models/Gridlock
http://ccl.northwestern.edu/netlogo/models/TrafficIntersection


CREDITS AND REFERENCES
----------------------
Model by: Sujai Kumar
Centre for Research in Cognitive Systems
NIIT Ltd., Synergy Building, IIT Campus, New Delhi 110016
http://ylog.org/sujai