This page was automatically generated by NetLogo 1.2beta2. Questions, problems? Contact feedback@ccl.northwestern.edu.
In order for this to work, this file, your model file (mazentraffic.nlogo), and the file nLogoLite.jar must all be in the same directory. (You can copy nLogoLite.jar from the directory where you installed NetLogo.)
On some systems, you can test the applet locally on your computer before uploading it to a web server. It doesn't work on all systems, though, so if it doesn't work from your hard drive, please try uploading it to a web server.
You don't need to include everything in this file in your page. If you want, you can just take the HTML code beginning with <applet> and ending with </applet>, and paste it into any HTML file you want. It's even OK to put multiple <applet> tags on a single page.
In this model, traffic jams previously were caused by one slow car. However that is not how traffic jams occur based on my experiences. They usually occur when a lot of traffic is bottlenecked trying to merge into one lane. For example, if there is an accident or road construction on a highway, then a lot of traffic has to be moved into a single lane. So I extended this model to capture that phenomenon. Traffic in the lower lane will stop when it can go no further on the road and wait for an opening in the upper lane. Traffic in the upper lane, as a result is often stopped because of merging cars. I also noticed a real-world phenomenon of traffic piling up in the upper lane while a few cars cut to the front, slowing traffic overall, but speeding their travel. This is somewhat of a game theory problem, I think. If all cars decide to travel in the same lane at similar speeds, then the group as a whole will benefit, but if even one car decides to cut, he/she will benefit while the whole group suffers. I experimented a little and this holds true for less number of cars. The max speed stays steady at the speed limit. However traffic gets too congested in one lane if you have too many cars and the max-speed goes down. I believe both are possible scenarios, but the former seems more likely.
created with NetLogo
view/download model file: mazentraffic.nlogo
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. It has been changed to be able to simulate a merge to one lane, which could be due to an accident or road construction.
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 the screen as they move, so the road is like a continuous loop.
The SPEED-UP slider controls the rate at which cars accelerate 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 SLOW-DOWN slider.
COOPERATE can be selected at any time. It tells the cars to use only one lane and follow the normal traffic rules.
DIFFERENT SPEEDS should be selected at startup to give different cars different max-speeds. It doesnt seem to have much affect.
The SIM-DELAY slider adds a time delay for more careful viewing.
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.
Plotwindow 1 plots three values as the model runs:
- the fastest speed of any car (this doesn't exceed the speed limit!)
- the slowest speed of any car
- the speed of a single car (turtle 0), painted red so it can be watched.
Notice not only the maximum and minimum, but also the variability -- the "jerkiness" of one vehicle.
When there are relatively few cars, then cooperation is good, but with a lot of cars, it doesnt seem to work out too well.
THINGS TO TRY
--------------
In this model there are three variables that can affect the tendency to create traffic jams: the initial NUMBER of cars, SPEED-UP, and SLOW-DOWN. 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 SLOW-DOWN to zero. What happens to the flow? Gradually increase SLOW-DOWN 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 speedup/slowdown values to some of the cars. Can one bad driver mess things up?
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?
NETLOGO FEATURES
-----------------
The turtles/cars use SPEED-AT to find out the value of the SPEED variable for other turtles/cars.
The plotwindow can plot both global values and the value for a single turtle, which helps one watch overall patterns and individual behavior at the same time.
The cars have decimal speeds and positions that are updated much more often than the time it takes for a car to move one space. Position is rounded off to deterimine which patch the car is on.
RELATED MODELS
---------------
"Traffic" (in StarLogoT) adds graphics, trucks, and a radar trap.
"Gridlock" (a HubNet model which can be run as a participatory simulation) looks at traffic in a grid with many intersections.
CREDITS AND REFERENCES
-----------------------
This model was adapted from the traffic model at the MIT Media Lab. 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. Adapted to NetLogo, 2000, as part of the Participatory Simulations Project.
To refer to this model in academic publications, please use: Wilensky, U. (1997). NetLogo Traffic Basic model. http://ccl.northwestern.edu/netlogo/models/TrafficBasic. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.