Report the indviduals among `turtles`

that are located on the patches at
`(dx, dy)`

distances of the
`agents`

.

turtlesAt(world, turtles, agents, dx, dy, breed, torus = FALSE) # S4 method for worldNLR,agentMatrix,matrix,numeric,numeric,missing turtlesAt(world, turtles, agents, dx, dy, torus) # S4 method for worldNLR,agentMatrix,matrix,numeric,numeric,character turtlesAt(world, turtles, agents, dx, dy, breed, torus = FALSE)

world | WorldMatrix or worldArray object. |
---|---|

turtles | AgentMatrix object representing the moving agents. |

agents | Matrix (ncol = 2) with the first column "pxcor" and the second column "pycor" representing the patches coordinates, or AgentMatrix object representing the moving agents. |

dx | Numeric. Vector of distances to the east (right) from the |

dy | Numeric. Vector of distances to the north (up) from the |

breed | Characters. Vector of "breed" names for the selected |

torus | Logical to determine if the |

AgentMatrix representing the individuals among `turtles`

of any of the given `breed`

, if specified,
which are located on the patches at `(dx, dy)`

distances of the
`agents`

.

If the patch at distance `(dx, dy)`

of an agent is outside of the `world`

's extent and `torus = FALSE`

,
no turtle is returned;
if `torus = TRUE`

, the turtle located on the patch whose coordinates
are defined from the wrapped `world`

is returned.

Wilensky, U. 1999. NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.

https://ccl.northwestern.edu/netlogo/docs/dictionary.html#turtles-at https://ccl.northwestern.edu/netlogo/docs/dictionary.html#at-points

w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9) t1 <- createTurtles(n = 10, coords = cbind(xcor = 0:9, ycor = 0:9), breed = c(rep("sheep", 5), rep("wolf", 5))) t2 <- turtlesAt(world = w1, turtles = t1, agents = turtle(t1, who = 0), dx = 1, dy = 1) t3 <- turtlesAt(world = w1, turtles = t1, agents = patch(w1, c(3,4,5), c(3,4,5)), dx = 1, dy = 1, breed = "sheep")