NetLogo banner
 Home Page
 Download
 Models
 Community Models
 Extensions
 User Manual:
  Web version
  Printable version
 FAQ
 Resources
 Contact Us

NetLogo Models Library:
HubNet Activities

For information about HubNet, click here.

(back to the library)

Gridlock

[screen shot] (The run link is disabled because HubNet Activities cannot be run in the web applet version of NetLogo)

Note: If you download the NetLogo application, all of the HubNet Activities are included.

This activity is available only for computer HubNet, not calculator HubNet.

WHAT IS IT?

Students control traffic lights in a real-time traffic simulation. The teacher controls overall variables, such as the speed limit and the number of cars. This allows students to explore traffic dynamics, which can lead into many areas of study, from calculus to social studies.

Challenge the students to develop strategies to improve traffic and discuss the different ways to measure the quality of traffic.

The coordinates for the traffic lights are based on the first quadrant of the Cartesian plane. Therefore, the traffic light with the coordinates (0,0) is in the lowest row and the left-most column. The traffic light above it has coordinates (0,1) and the traffic light to the right of it has (1,0).

For further documentation, see the Participatory Simulations Guide found at http://ccl.northwestern.edu/ps/

HOW TO USE IT

Quickstart Instructions:
Contains instructions as to how to quickly setup the model, and clients to run this activity. The instructions can be found below and can be seen progressively in the Quick Start instructions monitor in the Interface:

Teacher: Follow these directions to setup the HubNet activity.
Optional: Zoom In (see Tools in the Menu Bar)
Change the traffic grid (using the sliders GRID-SIZE-X and GRID-SIZE-Y) to make enough lights for everyone.
Change any other of the settings that you would like to change. For example, if you plan on running Gridlock in the MANUAL mode, be sure to have AUTO? set to OFF.

Press the SETUP button.
Press the LOGIN button.

Everyone: Open up a HubNet Client on your machine and input the IP Address of this computer, type your user name in the user name box and press ENTER.
Teacher: Once everyone is logged in and has a light, stop the LOGIN button by pressing it again.

Everyone: Whichever mode AUTO? is set for in NetLogo, you will control your intersection in a different way:
If you have chosen MANUAL, you can change the state of your light by pressing the CHANGE LIGHT button.
If you have chosen AUTO, you can change the phase of your light by moving the PHASE slider to a different position.

Teacher: Once everyone is ready, start the simulation by pressing the GO button.

Teacher: You may want to view some of the plots. Do this by changing the DISPLAY-WHICH-METRIC slider, which changes the plot displayed for everyone.
- Choose 0 to turn off all the plots.
- Choose 1 to see the STOPPED CARS plot.
- Choose 2 for the AVERAGE SPEED OF CARS plot.
- Choose 3 for the AVERAGE WAIT TIME OF CARS plot.
- Choose 4 for all the plots.

Teacher: To run the activity again with the same group, stop the model by pressing the GO button, if it is on. Change the values of the sliders and switches to the values you want for the new run. Press the SETUP button. Once everyone is ready, restart the simulation by pressing the GO button.

Teacher: To start the simulation over with a new group, stop the model by pressing the GO button, if it is on, press the RESET button in the Control Center and follow these instructions again from the beginning.

Buttons:
SETUP - generates a new traffic grid based on the current GRID-SIZE-X and GRID-SIZE-Y and NUM-CARS number of cars. This also clears all the plots. If the size of the grid has changed the clients will be assigned to new intersections.
GO - runs the simulation indefinitely
LOGIN - allows users to log into the activity without running the model or collecting data
REFRESH PLOTS - redraws the plots based on the current value of DISPLAY-WHICH-METRIC. Useful for looking at different plots when GO is off.

Sliders:
SPEED-LIMIT - sets the maximum speed for the cars
NUMBER - the number of cars in the simulation (you must press the SETUP or RE-RUN buttons to see the change)
SIMULATION-SPEED - the speed at which the simulation runs
TICKS-PER-CYCLE - sets the maximum value that the phase can be. This has no effect when the model is run with AUTO? false. Also, the phase that each user chooses is scaled to be less than or equal to this value.
GRID-SIZE-X - sets the number of vertical roads there are (you must press the SETUP button to see the change)
GRID-SIZE-Y - sets the number of horizontal roads there are (you must press the SETUP button to see the change)
DISPLAY-WHICH-METRIC - determines which plot is drawn in NetLogo:
- 0=No Plots.
- 1=STOPPED CARS
- 2=AVERAGE SPEED OF CARS
- 3=AVERAGE WAIT TIME OF CARS
- 4=All three plots.

Switches:
CRASH? - toggles car crashing
POWER? - toggles the presence of traffic lights
AUTO? - toggles between automatic mode, where the students' lights change on a cycle, and manual in which students directly control the lights with their clients. Lights which aren't associated with clients always change on a cycle.

Plots:
STOPPED CARS - displays the number of stopped cars over time
AVERAGE SPEED OF CARS - displays the average speed of cars over time
AVERAGE WAIT TIME OF CARS - displays the average time cars are stopped over time

Client Information
After logging in, the client interface will appear for the students. The controls for manual and automatic mode are both included, but which one works is based on the setting of the AUTO? switch in NetLogo. In MANUAL mode, click the CHANGE LIGHT button to switch the state of the light you control. In AUTO mode, move the PHASE slider to change the phase for your light. The phase determines what percent of the way through the cycle to switch on.

The clients also contain the same three plots as NetLogo and will show exactly the same data as NetLogo.

THINGS TO NOTICE

When cars have stopped at a traffic light, and then they start moving again, the traffic jam will move backwards even though the cars are moving forwards. Why is this? Discuss in your class possible reasons for this phenomena.

THINGS TO TRY

Try changing the speed limit for the cars. How does this affect the overall efficiency of the traffic flow? Are fewer cars stopping for a shorter amount of time? Is the average speed of the cars higher or lower than before?

Try changing the number of cars on the roads. Does this affect the efficiency of the traffic flow?

How about changing the speed of the simulation? Does this affect the efficiency of the traffic flow?

Using HubNet, try running this simulation with AUTO? being true and AUTO? being false. Is it harder to make the traffic move well using one scheme or the other? Why?

Using HubNet, try running this simulation with AUTO? being true. Try to find a way of setting the phases of the traffic lights so that the average speed of the cars is the highest. Now try to minimize the number of stopped cars. Now try to decrease the average wait time of the cars. Is there any correlation between these different metrics?

EXTENDING THE MODEL

Currently, the maximum speed limit (found in the SPEED-LIMIT slider) for the cars is 1.0. This is due to the fact that the cars must look ahead the speed that they are traveling to see if there are cars ahead of them. If there aren't, they speed up. If there are, they slow down. Looking ahead for a value greater than 1 is a little bit tricky. Try implementing the correct behavior for speeds greater than 1.

CREDITS AND REFERENCES

To refer to this model in academic publications, please use: Wilensky, U. and Stroup, W. (1999). NetLogo HubNet Gridlock model. http://ccl.northwestern.edu/netlogo/models/HubNetGridlock. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

In other publications, please use: Copyright 1999 Uri Wilensky and Walter Stroup. All rights reserved. See http://ccl.northwestern.edu/netlogo/models/HubNetGridlock for terms of use.

(back to the NetLogo Models Library)