Farsi / Persian
NetLogo Models Library:
This example demonstrates how to create a hexagonal grid for turtles to walk around on using links.
In order for the hexagons along the edges of the world to connect up with the hexagons on the opposite edges in the expected way, the size of the grid must be even in both dimensions. Therefore we use a world where the origin patch (0,0) is located in the corner rather in the center, since even-dimensioned worlds have no center patch.
If you do:
ask walkers [ pen-down ]
Notice that the lines the walkers draw appear behind the hexagons, because the hexagons are turtles. If you want the lines to be drawn on top of the hexagons, you need to transfer the hexagons to the drawing layer and hide the hexagon turtles, like this:
ask nodes [ stamp hide-turtle ]
On the computers we tested, this also makes the model run faster since the hexagons don't need to be redrawn individually every time the view is updated. Later, if you want to clear the drawing and redraw the hexagons, do:
clear-drawing ask nodes [ stamp ]
Link-Walking Turtles Example