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)

Communication-T-T Network Example

[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 code example is a variation on the Communication-T-T Example in the Code Examples section of the NetLogo models library. In the original code example, the turtles passed messages to nearby turtles. In this version, the turtles pass messages through a network. One turtle starts out with a message (the red turtle) and she spreads the message to other turtles she is linked with. When a turtle gets the message, it turns red.

The monitor keeps track of how many turtles have the message by reporting:

count turtles with [ message? ]

The plot helps you visualize how this value changes through time.

HOW IT WORKS

SETUP creates 500 turtles and gives them random coordinates in the world. Each turtle creates links with two other turtles, to form a network. One of the turtles is given a message, and is colored red to indicate that it has the message. In the GO procedure, the turtles pass messages. The way this is done is that each turtle queries the turtles it is linked with. If any of them have the message then the querying turtle gets the message. All turtles that have the message are colored red.

The network is formed randomly, by asking each turtle to create links with either one or two other turtles, depending on the value chosen for LINKS-PER-NODE.

HOW TO USE IT

Choose the value of LINKS-PER-NODE to characterize the network. Press SETUP to create the turtles and the network linking them and give one turtle the message. Then press GO to watch the message spread through the network.

THINGS TO NOTICE

Is the pattern of diffusion different or the same as the non-network version of this model? If it's different, can you explain why?

Do you notice any difference between the pattern of transmission when LINKS-PER-NODE is 1 versus the pattern when LINKS-PER-NODE is 2?

One thing you may notice is that, when LINKS-PER-NODE is 1, it sometimes happen that not all turtles get the message. Do you understand why that happens? It never happens with the non-network version of this model. Can you explain why?

Finally, do you think it is possible that not all turtles get the message when LINKS-PER-NODE is 2? Could you design a BehaviorSpace experiment that would help you answer this question?

EXTENDING THE MODEL

Wouldn't it be nice if you could compare the pattern of transmission with one link per node directly with the pattern for two links per node?

An easy way of doing that would be to create two different breeds of turtles and modify the SETUP procedure to ask each of these breeds to create links with other turtles of the same breed only: one link for turtles of the first breed and two links for the second breed. This way, you would have two entirely separate networks. The code for COMMUNICATE and RECOLOR would not have to be changed at all.

You could then modify the plot to have two different plot pens: one for the first breed and one for the second breed. This would allow you to compare the two patterns visually.

If you want to push things a step further, how about allowing the user to compare a variable number of networks, each with a different number of links per node? You could not declare a separate breed for each network, because you would not know in advance how many there needs to be. The same will be true of plot pens. Can you think of any ways to solve these problems?

The model currently stops when all turtles have received the message. However, sometimes the network is constructed in such a way that some turtles will never receive the message. Try to modify the code so that the model stops when this is the case.

NETLOGO FEATURES

This model uses turtle agents and link agents to represent a network.

The network is generated randomly, using the n-of primitive, which allows you to randomly select a variable number of agents from a list or an agentset. In this case, the number of agents selected by n-of is given by the LINKS-PER-NODE chooser.

This is not the only way to generate random networks. The Random Network model, from the same IABM chapter, shows you three other ways to do it. You can also use the network extension to generate networks.

RELATED MODELS

Communication T-T Example

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

This model was created 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.

(back to the NetLogo Models Library)