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


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


Begin NetLogo code:
set dead true
End NetLogo code


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.


Die was implemented by Ken Kahn.

BehaviourComposer: ignore everything after this.