Libraries‎ > ‎Library‎ > ‎Copying‎ > ‎

Add copies

BehaviourComposer: ignore everything before this.
Begin micro-behaviour:
Begin description:
Create exact copies of this agent. The newly created copies can be given any additional behaviours.
End description

Add copies

Begin NetLogo code:
substitute-text-area-for number-of-copies 9
add-copies 
    number-of-copies
    list-of-micro-behaviours "Additional behaviours" []
End NetLogo code

Variants

You can replace the contents of the edit box by any positive integer or expression to make a different number of copies. You can change the list of behaviours that each newly created copy has.

How this works

This uses the Behaviour Composer NetLogo command add-copies to make the specified number of exact copies and then any additional behaviours are run for each copy.

Related micro-behaviours

History

Add copies was implemented by Ken Kahn. The text area for the number of copies was added in March 2009. The dynamic list of micro-behaviours was added in July 2009.

BehaviourComposer: ignore everything after this.
Comments