nw:generate-lattice-2d
nw:generate-lattice-2d turtle-breed link-breed row-count column-count is-toroidal optional-command-block
Generates a new 2D lattice network (basically, a grid) of row-count rows and column-count columns. The grid will wrap around itself if is-toroidal is true
.
If you specify an optional-command-block, it is executed for each turtle in the newly created network. For example:
nw:generate-lattice-2d turtles links 10 10 false [ set color red ]
The turtles are generated in the order that they appear in the lattice. So, for instance, to generate a lattice accross the entire world, and lay it out accordingly, try the following:
nw:generate-lattice-2d turtles links world-width world-height false
(foreach (sort turtles) (sort patches) [ [t p] -> ask t [ move-to p ] ])
Take me to the full Networks Extension Dictionary