netlogo - Making turtles wait every time -


i work in epidemic algorithm , use combination between gossip algorithm , sir model. part of trying change color of 1 of neighbors turtles , wait 3.0 color other 1 until turtles color green.

but program function wait 1 time.now how make turtles wait every time 3.0 ticks color neighbor.

this code :

to setup    clear-all    reset-ticks     crt 100     set  color  blue end go     wait 3.0     ask one-of out-link-neighbors [color = blue] [      set color green     ask (link-with myself) [     set color green - 3    ] ]   tick   end 

and thank all.

the wait in go command stalls execution (in seconds). want color on ticks. so, instead, want mod ticks 3 , whenever remainder 0, color green.

to go     if ticks mod 3 = 0     [         ask one-of out-link-neighbors [color = blue]          [              set color green             ask (link-with myself) [set color green - 3]         ]    ] 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -