patchAt | R Documentation |
Patches
atReport the coordinates of the patches
at (dx, dy)
distances of the agents
.
patchAt(world, agents, dx, dy, torus = FALSE)
## S4 method for signature 'worldNLR,matrix,numeric,numeric'
patchAt(world, agents, dx, dy, torus = FALSE)
world |
|
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 |
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
,
NA
are returned
for the patch
coordinates;
if torus = TRUE
, the patch
coordinates from a wrapped world
are
returned.
Matrix (ncol
= 2) with the first column pxcor
and the second column
pycor
representing the coordinates of the patches
at (dx, dy)
distances of the agents
. The order of the patches
follows the order
of the agents
.
Sarah Bauduin
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#patch-at
https://ccl.northwestern.edu/netlogo/docs/dictionary.html#at-points
w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9)
patchCorner <- patchAt(world = w1, agents = patch(w1, 0, 0), dx = 1, dy = 1)
t1 <- createTurtles(n = 1, coords = cbind(xcor = 0, ycor = 0))
patchCorner <- patchAt(world = w1, agents = t1, dx = 1, dy = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.