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

Add copies of another

BehaviourComposer: ignore everything before this.

Begin micro-behaviour:

Begin description:

Make exact copies of another agent at the location of this agent.

End description

Make copies of another

Begin NetLogo code:

substitute-text-area-for other-agent any-of-kind "Prototype1" 
substitute-text-area-for number-of-copies 1   
let copies 
    ( number-of-copies )
    ( other-agent )
    list-of-micro-behaviours "Additional behaviours" []
let x xcor
let y ycor
ForEach copies
        [ask ? [setxy x y]]

End NetLogo code


You can edit the text areas to specify what should be copied and how many copies to make. You can add micro-behaviours to give special behaviours or attributes to the copies.

How this works

This uses the Behaviour Composer's NetLogo reporter add-copies-of-another.

Related micro-behaviours


Make copies of another was implemented by Ken Kahn on 7 December 2011.

BehaviourComposer: ignore everything after this.