NetLogo: Is there any way to change patch colour under turtles which dies? -


i wrote simulation contain ants , spiders. spider kill ants , not things happens spider take of ant venom , reduces health. @ point spider die after there energy equal 0 . want spider die , change patch colours under death spider black brown

i have tried code didn't work .spider disappear (die) pcolor not change

to spider-death     if energy  <= 0 [ask antiagents-here [die if pcolor = black [set pcolor brown]]] end 

please help

after agent dies, no longer exists, , therefore can no longer take actions.

so example:

ask turtles [   die   print "hello!" ] 

nothing ever printed, because turtle dies before can print anything.

so in code, need change part:

die if pcolor = black [set pcolor brown] 

to:

if pcolor = black [set pcolor brown] die 

Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -