home {NetLogoR} | R Documentation |
Return home
Description
Move the turtles
back home
.
Usage
home(world, turtles, home)
## S4 method for signature 'worldNLR,agentMatrix,character'
home(world, turtles, home)
Arguments
world |
|
turtles |
|
home |
Character. Can take one of the following options to define where
to relocate the `home = "home0"` will place the `turtles` at the location `x = 0, y = 0`. `home = "center"` will place the `turtles` at the center of the `world`. `home = "pCorner"` will place the `turtles` at the center of the `patch` located in the left bottom corner of the `world`. `home = "corner"` will place the `turtles` at the left bottom corner of the `world`. |
Value
AgentMatrix
representing the turtles
with updated
coordinates and updated data for their previous coordinates prevX
and prevY
.
Author(s)
Sarah Bauduin
References
Wilensky, U. 1999. NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.
See Also
https://ccl.northwestern.edu/netlogo/docs/dictionary.html#home
Examples
w1 <- createWorld(
minPxcor = 0, maxPxcor = 4, minPycor = 0, maxPycor = 4,
data = runif(25)
)
t1 <- createTurtles(n = 10, coords = randomXYcor(w1, n = 10))
plot(w1)
points(t1, col = "black", pch = 16)
t1 <- home(world = w1, turtles = t1, home = "pCorner")
points(t1, col = "red", pch = 16)
[Package NetLogoR version 1.0.5 Index]