NetLogo User Community Models
WHAT IS IT?
This model models the movement of cars on a highway. Each car follows a simple set of rules: it slows down (decelerates) if it sees a car close ahead, and speeds up (accelerates) if it doesn't see a car ahead.
The model demonstrates how traffic jams can form even without any accidents, broken bridges, or overturned trucks. No "centralized cause" is needed for a traffic jam to form.
HOW TO USE IT
Click on the SETUP button to set up the cars. Set the NUMBER slider to change the number of cars on the road.
Click on DRIVE to start the cars moving. Note that they wrap around the world as they move, so the road is like a continuous loop.
The ACCELERATION slider controls the rate at which cars accelerate (speed up) when there are no cars ahead.
When a car sees another car right in front, it matches that car's speed and then slows down a bit more. How much slower it goes than the car in front of it is controlled by the DECELERATION slider.
THINGS TO NOTICE
Traffic jams can start from small "seeds." These cars start with random positions and random speeds. If some cars are clustered together, they will move slowly, causing cars behind them to slow down, and a traffic jam forms.
Even though all of the cars are moving forward, the traffic jams tend to move backwards. This behavior is common in wave phenomena: the behavior of the group is often very different from the behavior of the individuals that make up the group.
The plot shows three values as the model runs:
Notice that the default settings have cars decelerating much faster than they accelerate. This is typical of traffic flow models.
Even though both ACCELERATION and DECELERATION are very small, the cars can achieve high speeds as these values are added or subtracted at each tick.
THINGS TO TRY
In this model there are three variables that can affect the tendency to create traffic jams: the initial NUMBER of cars, ACCELERATION, and DECELERATION. Look for patterns in how the three settings affect the traffic flow. Which variable has the greatest effect? Do the patterns make sense? Do they seem to be consistent with your driving experiences?
Set DECELERATION to zero. What happens to the flow? Gradually increase DECELERATION while the model runs. At what point does the flow "break down"?
EXTENDING THE MODEL
Try other rules for speeding up and slowing down. Is the rule presented here realistic? Are there other rules that are more accurate or represent better driving strategies?
In reality, different vehicles may follow different rules. Try giving different rules or ACCELERATION/DECELERATION values to some of the cars. Can one bad driver mess things up?
The asymmetry between acceleration and deceleration is a simplified representation of different driving habits and response times. Can you explicitly encode these into the model?
What could you change to minimize the chances of traffic jams forming?
What could you change to make traffic jams move forward rather than backward?
Make a model of two-lane traffic.
The plot shows both global values and the value for a single turtle, which helps one watch overall patterns and individual behavior at the same time.
The WATCH command is used to make it easier to focus on the red car.
"Traffic" (in StarLogoT) adds graphics, trucks, and a radar trap.
"Gridlock" (a HubNet model which can be run as a participatory simulation) models traffic in a grid with many intersections.
HOW TO CITE
If you mention this model in an academic publication, we ask that you include these citations for the model itself and for the NetLogo software:
In other publications, please use:
Copyright 1997 Uri Wilensky. All rights reserved.
Permission to use, modify or redistribute this model is hereby granted, provided that both of the following requirements are followed:
This model was created as part of the project: CONNECTED MATHEMATICS: MAKING SENSE OF COMPLEX PHENOMENA THROUGH BUILDING OBJECT-BASED PARALLEL MODELS (OBPML). The project gratefully acknowledges the support of the National Science Foundation (Applications of Advanced Technologies Program) -- grant numbers RED #9552950 and REC #9632612.
This model was developed at the MIT Media Lab using CM StarLogo. See Resnick, M. (1994) "Turtles, Termites and Traffic Jams: Explorations in Massively Parallel Microworlds." Cambridge, MA: MIT Press. Adapted to StarLogoT, 1997, as part of the Connected Mathematics Project.
This model was converted to NetLogo as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227. Converted from StarLogoT to NetLogo, 2001.
(back to the NetLogo User Community Models)