Beginners Interactive NetLogo Dictionary (BIND)
Farsi / Persian
NetLogo Models Library:
This demonstrates how to make a model that uses a hexagonal grid of cells.
The cellular automaton rules used produce a snowflake-like pattern.
Since patches are square, we must represent the cells as turtles instead.
Each patch sprouts a "cell" turtle. Turtles on even patch columns are offset down by half a patch. (Since the south boundary of a patch is part of the patch, this does not move the turtle to a different patch.)
The resulting lattice has the correct structure, but distances and angles are distorted. So the hexagons aren't actually regular, but it doesn't matter as long as you don't try to use primitives such as
Also, you must use the
hex-neighbors variable instead of the built-in
This example is for stationary cells. Hex Turtles Example shows how to make turtles that move along a hexagonal lattice. (It would also be possible to combine both techniques in a single model.)
Link Lattice Example and Lattice-Walking Turtles Example demonstrate another approach to making a hexagonal lattice, using links instead of just patches.