Libraries‎ > ‎Library‎ > ‎Removing‎ > ‎

Die

BehaviourComposer: ignore everything before this.
Begin micro-behaviour:
Begin description:
Remove this agent from the model.
End description

Die

Begin NetLogo code:
set dead true
End NetLogo code

Variants

If you want an agent to remain (perhaps for generating statistics) but to leave the model then use Hide instead. Note that, unlike this micro-behaviour, Hide will not recycle the computational resources used.

How this works

At the end of every simulation step all agents marked as dead are removed from the simulation. The NetLogo command die should not be used since that causes the agent to be removed immediately while a cycle is unfinished.

Related micro-behaviours

Hide can be used to temporarily remove an agent from the model. Note that the agent's behaviour will still execute but others will not 'see' it to interact.

History

Die was implemented by Ken Kahn.

BehaviourComposer: ignore everything after this.
Comments