nw:turtles-on-path-to
nw:turtles-on-path-to target-turtle
Like nw:path-to
, but the turtles on the path are reported, instead of the links, including the source turtle and target turtle.
Example:
to go
clear-all
create-turtles 5
ask turtle 0 [ create-link-with turtle 1 ]
ask turtle 1 [ create-link-with turtle 2 ]
ask turtle 0 [ create-link-with turtle 3 ]
ask turtle 3 [ create-link-with turtle 4 ]
ask turtle 4 [ create-link-with turtle 2 ]
ask turtle 0 [ show nw:turtles-on-path-to turtle 2 ]
end
Will output:
(turtle 0): [(turtle 0) (turtle 1) (turtle 2)]
Take me to the full Networks Extension Dictionary