netlogo - Initialization and termination of Turtles timer -
in procedure want start timer every turtles (agent) when change shape "shape2" "shape1", , timer expire after 10 ticks , shape changes "shape1" . procedure works when hit "go" works first 10 ticks counted. after not called. have called procedure name "change" in go block. to change let test one-of breed-here [ shape = "shape2" ] if test != nobody , [ ticks ] of test = 10 [ask breed [ shape = "shape2" ] [ set shape "shape1" ] ] end the go block statement : to go ask breed [ shape = "shape2" ] [ change ] end here illustration using patches. (colors stand in shapes.) patches-own [shape-timer] globals [s1 s2] setup ca set s1 blue ;"shape" 1 set s2 red ;"shape" 2 ask patches [set pcolor one-of (list s1 s2)] end temp-change-shape set pcolor s2 set plabel "temp" set shape-timer 10 end update set shape