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

NetLogo code v2

BehaviourComposer: ignore everything before this.

We recommend that instead of using this you use the new 'Create a new micro-behaviour' button in the Composer area.

Begin micro-behaviour:

Begin description:

Add NetLogo code.

End description

NetLogo code

Begin NetLogo code:

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

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.

History

NetLogo code was implemented by Ken Kahn.

BehaviourComposer: ignore everything after this.