| patchLeft | R Documentation |
Patches on the leftReport the coordinates of the patches at the given distances of the turtles
and given angle left of their headings.
patchLeft(world, turtles, dist, angle, torus = FALSE)
## S4 method for signature 'worldNLR,agentMatrix,numeric,numeric'
patchLeft(world, turtles, dist, angle, torus = FALSE)
world |
|
turtles |
|
dist |
Numeric. Vector of distances from the |
angle |
Numeric. Vector of angles in degrees by which the |
torus |
Logical to determine if the |
If a given dist value is negative, then the turtle would look backward.
If a given angle value is negative, then the turtle would look to the right.
If `torus = FALSE` and the `patch` at distance `dist` of a `turtle`
and `angle` degrees to the left of its `heading` is outside the
`world`'s extent, `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 dist
distances of the turtles and angle to the left of their headings.
The order of the patches follows the order of the turtles.
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#patch-lr-and-ahead
w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9)
t1 <- createTurtles(n = 1, coords = cbind(xcor = 2, ycor = 2), heading = 90)
patchLeft(world = w1, turtles = t1, dist = 2, angle = 90)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.