This page was automatically generated by NetLogo 5.0.3. The applet requires Java 5 or higher. Java must be enabled in your browser settings. Mac users must have Mac OS X 10.4 or higher. Windows and Linux users may obtain the latest Java from Oracle's Java site.

powered by NetLogo

view/download model file: metro.nlogo


This is an abstract simulation of a public transportation system. It has been used to explore the equal headway instability phenomenon (Gershenson and Pineda, 2009) and to test different methods to promote equal headways.


Trains move along the cyclic tracks transporting passengers. They move unless there is a vehicle (or a red light) in front of them. At stations they stop until all passengers to descend exit. Passengers board vehicles unless the vehicles are full or another restriction forces vehicles to leave the stations.


Press “Setup” to initialize the simulation with the parameters above the button.
Press “Go” or “Step” to run the simulation.
Press “Init” to reset the simulation with the same paramenters which were used in Setup.
Parameters above these buttons have to be set before the simulation starts. Parameters below can be adjusted during a simulation run.

“#trains” indicates the number of vehicles in the simulation.
Vehicles can be initialized with “init-trains” equidistant, with random positions, or aggregated.
“#stations” indicates the number of stations in the simulation.
Stations can be initialized with “init-stations” equidistant or with random positions
“#lights” indicates the number of traffic lights in the simulation.
Traffic lights can be initialized with “init-lights” equidistant or with random positions.
“light-period” indicates the traffic lights cycle length.
“mean-passenger-interval” indicates the average time (lambda of a Poisson distribution) between passenger arrivals at each station. If “homo-pass?” is true, this will be equal for all stations. Otherwise, each station will choose from a Poisson distribution with mean “mean-passenger-interval” their own lambda.
Press “UpdateParam” to update the values of mean passenger intervals for stations, e.g. “homo-pass?” was changed or the intervals (shown at bottom left of stations) are not desired ones.

“method” selects the headway regulation method:
manual allows user to use parameters below.
default has no restrictions (always leads to unstable headways)
min adaptively adjusts “min-station-wait-time” (Gershenson and Pineda, 2009)
max adaptively adjusts “max-station-wait-time” (Gershenson and Pineda, 2009)
min-max adaptively adjusts “min-station-wait-time” and “max-station-wait-time”
self-org uses antipheromones to self-organize headways of neighboring trains
(Gershenson, 2011).
self-org2 uses antipheromones to self-organize headways of alternating trains
(with one train in between).

“train-capacity” sets the maximum number of passengers that can fit in a vehicle.
“min-station-wait-time” restricts departure of vehicles only after they have spent a minimum time at stations.
“max-station-wait-time” forces deprture of vehicles (only if all exiting passengers descended) after a maximum time at stations.
“max-margin” parameter for self-org method (Gershenson, 2011).

“station-buffers?” creates buffers at station entrances.
Only a “buffer-capacity” number of passengers are allowed into the station entrance, the rest arrive to its right.
“max-speed” regulates the maximum speed of vehicles.
“min-intertrain-d” forces vehicles to stop when they are at this distance from a vehicle ahead.
“pass-allowed?” lets vehicles to go on top of each other.
“update-method” parameter for min, max, and min-max methods (Gershenson and Pineda, 2009).

“plots?” Switches data plotting.
Press “Reset lists” to initialize data measuring and plotting.
“histogram-probe” determines the update frequency of histograms.



Gershenson, C. and L. A. Pineda (2009). Why Does Public Transport Not Arrive on Time? The Pervasiveness of Equal Headway Instability. PLoS ONE 4(10): e7292
Gershenson, C. (2011) Self-organization leads to supraoptimal performance in public transportation systems. PLoS ONE 6(6): e21469.

Carlos Gershenson's homepage