distance1.0

distance agent Turtle Command Patch Command

Reports the distance from this agent to the given turtle or patch.

The distance to or a from a patch is measured from the center of the patch. Turtles and patches use the wrapped distance (around the edges of the world) if wrapping is allowed by the topology and the wrapped distance is shorter.

ask turtles [ show max-one-of turtles [distance myself] ]
;; each turtle prints the turtle farthest from itself

Take me to the full NetLogo Dictionary