NetLogo banner

 Home
 Download
 Help
 Resources
 Extensions
 FAQ
 NetLogo Publications
 Contact Us
 Donate

 Models:
 Library
 Community
 Modeling Commons

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

  Donate

NetLogo Models Library:
Code Examples

(back to the library)

Communication-T-T Example

[screen shot]

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

WHAT IS IT?

This code example is a simple demo of turtle-turtle communications. We create 500 turtles. One turtle starts out with a message (the red turtle) and she spreads the message to other turtles.

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. Notice the "S" shape of the plotted curve.

Note that if you call a procedure inside ask turtles [ ], then everything in that procedure will be executed by all of the turtles.

(back to the NetLogo Models Library)