Random Messenger Turtles

Random Messenger Turtles preview image

1 collaborator

Ahnaf_tahmid Ahnaf Tahmid (Author)

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 6.1.1 • Viewed 124 times • Downloaded 18 times • Run 0 times
Download the 'Random Messenger Turtles' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

(a general understanding of what the model is trying to show or explain)

HOW IT WORKS

(what rules the agents use to create the overall behavior of the model)

HOW TO USE IT

(how to use the model, including a description of each of the items in the Interface tab)

THINGS TO NOTICE

(suggested things for the user to notice while running the model)

THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

turtles-own [message?] ; true or false? does a turtle own a message?

to setup ; in order to setup a new model, do the following
  clear-all
  reset-ticks
  create-turtles 75 ; create 75 turtles
  [
    set message? false ; nobody has a message
    setxy random-xcor random-ycor ; spread turtles on random x&y coordinates
  ]
  ask turtles
  [
    set shape "turtle" ; check out others under tools > Turtle shape editor
    set size 3
    set color red ; try different colors
  ]
  ask one-of turtles [set message? true] ; give one of the turtles a message
end 

to go ; in roder to go
  ask turtles
  [
    ifelse coin-flip? [right random 60] [left random 60]
    ; if coin-flip is true (0) then turn right up to 60 degrees, otherwise (else) left
    forward random 4 ; move randomly between 0 and 3 steps forward

    ; if the turtle meets another turtle at the same patch, then communicate the message
    if any? other turtles-here with [message?] ; if another turtle is at the same patch
    [set message? true] ; communicate the message
    if message? [set color yellow] ; make all carriers of message yellow
  ]
  tick ; add one unit of time to our counter
end 

to-report coin-flip?
  report random 2 = 0
end 

There is only one version of this model, created almost 5 years ago by Ahnaf Tahmid.

Attached files

File Type Description Last updated
Random Messenger Turtles.png preview Preview for 'Random Messenger Turtles' almost 5 years ago, by Ahnaf Tahmid Download

This model does not have any ancestors.

This model does not have any descendants.