| turtlesAt | R Documentation |
Turtles atReport the individuals 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 signature
## 'worldNLR,agentMatrix,matrix,numeric,numeric,missing'
turtlesAt(world, turtles, agents, dx, dy, torus)
## S4 method for signature
## 'worldNLR,agentMatrix,matrix,numeric,numeric,character'
turtlesAt(world, turtles, agents, dx, dy, breed, torus = FALSE)
world |
|
turtles |
|
agents |
Matrix ( `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 |
torus |
Logical to determine if the |
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.
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.
Sarah Bauduin
Wilensky, U. 1999. NetLogo. https://www.netlogo.org. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.
https://docs.netlogo.org/dictionary.html#turtles-at
https://docs.netlogo.org/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"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.