powered by
Patches
Report the coordinates of the patches under the turtles locations.
patches
turtles
patchHere(world, turtles)# S4 method for worldNLR,agentMatrix patchHere(world, turtles)
# S4 method for worldNLR,agentMatrix patchHere(world, turtles)
Matrix (ncol = 2) with the first column pxcor and the second column pycor representing the coordinates of the patches at the turtles
ncol
pxcor
pycor
location. The order of the patches follows the order of the turtles.
WorldMatrix or worldArray object.
WorldMatrix
worldArray
AgentMatrix object representing the moving agents.
AgentMatrix
agents
Sarah Bauduin
If a turtle is located outside of the world's extent, NA are returned for the patch coordinates.
turtle
world
NA
patch
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-here
w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9) t1 <- createTurtles(n = 10, coords = randomXYcor(w1, n = 10)) patchHere(world = w1, turtles = t1)
Run the code above in your browser using DataLab