BehaviourComposer: ignore everything before this. Begin micro-behaviour: Begin description:Place a set of agents in a rectangular prism in 3D NetLogo.End description Rectangular prism layout Begin NetLogo code: substitute-text-area-for upper-left-x min-pxcorsubstitute-text-area-for upper-left-y min-pycorsubstitute-text-area-for upper-left-z min-pzcorsubstitute-text-area-for prism-width world-widthsubstitute-text-area-for prism-height world-heightsubstitute-text-area-for prism-depth world-depthsubstitute-text-area-for agents-to-lay-out-in-a-prism all-individuals layout-rectangular-prism agents-to-lay-out-in-a-prism upper-left-x ; upper left x upper-left-y ; upper left y upper-left-z ; upper left z prism-width ; width prism-height ; height prism-depth ; depth End NetLogo code VariantsTo change the location of the prism of agents change the upper left x, y, and z. To make a prism of a different size edit the width and height. If you want separate prisms for different kinds of agents, e.g. "Sheep" then fill the first text area with all-of-kind "Sheep". How this worksThis uses the Modelling4All NetLogo layout-rectangular-prism command to place the agents in a rectangular prism. Related micro-behavioursThe two-dimensional equivalent of this behaviours is Lay out grid.Other layouts are supported by Lay out circle and Lay out linked agents. HistoryGrid rectangular prism was implemented by Ken Kahn on 2 December 2014. BehaviourComposer: ignore everything after this. |