Libraries‎ > ‎Library‎ > ‎Miscellaneous‎ > ‎

NetLogo code

BehaviourComposer: ignore everything before this.

Begin micro-behaviour:

Begin description:

Add any NetLogo command including those that define a new reporter or command to NetLogo.

End description

NetLogo code

Begin NetLogo code:

substitute-text-area-for code to-report total-population\n  report count all-individuals\nend
code

End NetLogo code

Variants

Any NetLogo code can be placed in the text area. E.g.

watch any-of-kind "Person"
If the code begins with to or to-report then it will be added to the commands and reporters that other micro-behaviours can use.

How this works

If the code begins with to or to-report this adds to the generated NetLogo file a new NetLogo reporter or command that can be used by any micro-behaviour. Otherwise this can be any code NetLogo command to be run by the agent with this behaviour.

Related micro-behaviours

History

NetLogo code was implemented by Ken Kahn.

BehaviourComposer: ignore everything after this.

Comments