NetLogo banner

Home
Download
Help
Forum
Resources
Extensions
FAQ
NetLogo Publications
Contact Us
Donate

Models:
Library
Community
Modeling Commons

Beginners Interactive NetLogo Dictionary (BIND)
NetLogo Dictionary

User Manuals:
Web
Printable
Chinese
Czech
Farsi / Persian
Japanese
Spanish

  Donate

NetLogo Models Library:
IABM Textbook/chapter 5

(back to the library)

Traffic Basic Utility

[screen shot]

If you download the NetLogo application, this model is included. You can also Try running it in NetLogo Web

ACKNOWLEDGMENT

This model is from Chapter Five of the book "Introduction to Agent-Based Modeling: Modeling Natural, Social and Engineered Complex Systems with NetLogo", by Uri Wilensky & William Rand.

  • Wilensky, U. & Rand, W. (2015). Introduction to Agent-Based Modeling: Modeling Natural, Social and Engineered Complex Systems with NetLogo. Cambridge, MA. MIT Press.

This model is in the IABM Textbook folder of the NetLogo Models Library. The model, as well as any updates to the model, can also be found on the textbook website: http://www.intro-to-abm.com/.

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. Cars start at a random speed between 0.1 and 1. This model extends the Traffic Basic model, from the social science section of the NetLogo models library, to include a utility function for the cars.

In this version of the model, we have the cars change their speeds in order to improve their fuel efficiencies. As a result, the agents have to speed up and slow down at different times than they do in the Traffic Basic model in order to minimize their gas usage while still not causing accidents. Giving the agents this type of decision-making process gives them a utility-based form of agent cognition in which they attempt to maximize a utility function—namely, their fuel efficiency.

In the language of utility functions, each car agent is minimizing a function f, defined by:

f(v) = |vv*|

where v is the current velocity of the car and v* is the most efficient velocity.

The model sets the optimal speed for the cars (best fuel efficiency) to be 0.45. If the acceleration rule speeds the car past the optimal speed, the car decelerates instead of accelerating.

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 GO 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.

The EFFICIENT-SPEED slider is the basis of the utility function for the cars. Cars slow down if they are exceeding it.

THINGS TO NOTICE

How are the results different from the Traffic Basic model? Are traffic jams more or less likely than in the Traffic Basic model? If so, why? If not, why not?

How does the model's behavior change with different values of EFFICIENT-SPEED?

THINGS TO TRY

Try very low and very high values of EFFICIENT-SPEED. Are there values where the model behavior changes qualitatively?

Can you think of a strategy for finding the EFFICIENT-SPEED that leads to the highest overall average speed for cars?

What happens when you start with a very low EFFICIENT-SPEED and gradually increase it?

EXTENDING THE MODEL

The value of EFFICIENT-SPEED is currently the same for every car. What if each car had a different efficient speed? Use random-normal to give each car a different efficient speed while keeping the average close to the value of the EFFICIENT-SPEED slider. But be careful, as random-normal is unbounded: it has a small probability of giving very high or very low values. Make sure that you also set a minimum and a maximum for efficient speed.

RELATED MODELS

  • "Traffic Basic": a simple model of the movement of cars on a highway.

  • "Traffic Basic Adaptive": a version of "Traffic Basic" where cars adapt their acceleration to try and maintain a smooth flow of traffic.

  • "Traffic Basic Adaptive Individuals": a version of "Traffic Basic Adaptive" where each car adapts individually, instead of all cars adapting in unison.

  • "Traffic 2 Lanes": a more sophisticated two-lane version of the "Traffic Basic" model.

  • "Traffic Intersection": a model of cars traveling through a single intersection.

  • "Traffic Grid": a model of traffic moving in a city grid, with stoplights at the intersections.

  • "Traffic Grid Goal": a version of "Traffic Grid" where the cars have goals, namely to drive to and from work.

  • "Gridlock HubNet": a version of "Traffic Grid" where students control traffic lights in real-time.

  • "Gridlock Alternate HubNet": a version of "Gridlock HubNet" where students can enter NetLogo code to plot custom metrics.

The traffic models from chapter 5 of the IABM textbook demonstrate different types of cognitive agents: "Traffic Basic Utility" demonstrates utility-based agents, "Traffic Grid Goal" demonstrates goal-based agents, and "Traffic Basic Adaptive" and "Traffic Basic Adaptive Individuals" demonstrate adaptive agents.

HOW TO CITE

This model is part of the textbook, “Introduction to Agent-Based Modeling: Modeling Natural, Social and Engineered Complex Systems with NetLogo.”

If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.

For the model itself:

Please cite the NetLogo software as:

Please cite the textbook as:

  • Wilensky, U. & Rand, W. (2015). Introduction to Agent-Based Modeling: Modeling Natural, Social and Engineered Complex Systems with NetLogo. Cambridge, MA. MIT Press.

COPYRIGHT AND LICENSE

Copyright 2008 Uri Wilensky.

CC BY-NC-SA 3.0

This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.

(back to the NetLogo Models Library)