BehaviourComposer: ignore everything before this.
I 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 columns: 80 rows: 5 comment ; Notes <br>; <br>; <br>; <br>; substitute-text-area-for columns: 71 repetitions 500 substitute-text-area-for columns: 75 nodes-to-layout all-individuals substitute-text-area-for columns: 75 links-in-layout links substitute-text-area-for columns: 75 spring-constant .2 substitute-text-area-for columns: 75 spring-length 5 substitute-text-area-for columns: 75 repulsion-constant 1 substitute-text-area-for columns: 76 rows: 7 setup-code ; place for code to set things up (if needed) comment 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 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 all-individuals with [kind = "Sheep"]. To limit the layout to a subset of the links replace the contents of the second text area.
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.
This was implemented by Ken Kahn on 1 February 2011.
BehaviourComposer: ignore everything after this.