BehaviourComposer: ignore everything before this.
Begin description:Lay out a set of agents where the agents repel each other and the links between them act like springs.
Lay out linked agentsBegin NetLogo code:
substitute-text-area-for repetitions 500 substitute-text-area-for nodes-to-layout all-individuals substitute-text-area-for links-in-layout links substitute-text-area-for spring-constant .2 substitute-text-area-for spring-length 5 substitute-text-area-for repulsion-constant 1 substitute-text-area-for setup-code ; place for code to set things up (if needed) nested-no-display setup-code repeat repetitions [layout-spring nodes-to-layout links-in-layout spring-constant ; a measure of the "tautness" of the spring spring-length ; the "zero-force" length or the natural length of the springs repulsion-constant] ; a measure of repulsion between the nodes nested-displayEnd NetLogo code
All the text areas can be edited. If you want to limit the agents involved edit the first box. E.g. To only layout sheep replace it with
This uses the NetLogo layout-spring primitive to place the agents. It repeats calls to layout-spring since each time the constraints are solved bringing the configuration of agents closer to the ideal solution.
Lay out linked agents was implemented by Ken Kahn on 1 February 2011.
BehaviourComposer: ignore everything after this.