nw:generate-watts-strogatz
nw:generate-watts-strogatz turtle-breed link-breed num-nodes neighborhood-size rewire-probability optional-command-block
Generates a new Watts-Strogatz small-world network.
The algorithm begins by creating a ring of nodes, where each node is connected to neighborhood-size
nodes on either side. Then, each link is rewired with probability rewire-prob
.
If you specify an optional-command-block, it is executed for each turtle in the newly created network. Furthermore, the turtles are generated in the order they appear as in create-ordered-turtles
. So, in order to lay the ring out as a ring, you can do something like:
nw:generate-watts-strogatz turtles links 50 2 0.1 [ fd 10 ]
Take me to the full Networks Extension Dictionary