Traffic

What is it?

This project models the movement of cars on a highway. Each car follows a simple set of rules: it slows down if it sees a car close ahead and speeds up if it doesn't see a car ahead. The project 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. Click on go to start the cars moving and the swans swimming.

The number slider controls the number of cars on the road. (If you reset the number of cars, you will need to stop-it and then click setup for the changes to take effect.)

The lookahead slider controls the distance that drivers look ahead (in deciding whether to slow down). The speedup slider controls the rate at which cars accelerate when there are no cars ahead. The slowdown slider controls the rate at which cars decelerate when there is a car close ahead.

 

Things to Notice

Traffic jams can start from small "seeds." 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 causing a traffic jam to form.

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.

Explorations
  • 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?

StarLogo Features
The cars use speed-at to find out the value of the speed variable for other cars.


We welcome your feedback and suggestions! Please send us email