BehaviourComposer: ignore everything before this.
Begin description: Place a set of agents in a rectangular grid. End description
Begin NetLogo code:
substitute-text-area-for upper-left-x min-pxcor substitute-text-area-for upper-left-y min-pycor substitute-text-area-for grid-width world-width substitute-text-area-for grid-height world-height substitute-text-area-for agents-to-lay-out-in-a-grid all-individuals layout-grid agents-to-lay-out-in-a-grid upper-left-x ; upper left x upper-left-y ; upper left y grid-width ; width grid-height ; height
End NetLogo code
To change the location of the grid of agents change the upper left x and y. To make a grid of a different size edit the width and height. If you want separate rectangles for different kinds of agents, e.g. "Sheep" then fill the first text area with all-of-kind "Sheep".
This uses the Modelling4All NetLogo layout-grid command to place the agents in a rectangle.
The three-dimensional version of this is Lay out rectangular prism.
Grid layout was implemented by Ken Kahn on 10 November 2009.
BehaviourComposer: ignore everything after this.