The base class linked_node
provides functionality to create systems of interconnected turtles.
It is used by two simulations: the string fixed at one end point and the net stretched on a frame. You can
click and move the turtle in both simulations.
Here are some rules of using the base class to create custom nodes:
:links
, so usually you need to create nodes and initialize
them in the second pass, when all turtles are present in some structure.initialized :r :px :py
function. It is needed to setup the initial position of the turtle and its radius which is used to calculate
a force between nodes.
fcoeff :d
to change the default formula of the force at specified distance.
"fixed := true
to pin the turtle in its position.
"clock := timer [
signalw "forces
(signalw "step :dt)
signal "loss
] 20
Timer interval should be short to keep high precision of step and force calculations, and long enough to let
the turtles make theirs steps.
"painter := timer [refresh] 50