face(turtles, agents2, world, torus = FALSE) # S4 method for agentMatrix,matrix face(turtles, agents2, world, torus = FALSE)
Logical to determine if the
AgentMatrix representing the
turtles with updated
The number of agents/locations in
agents2 must be equal to 1 or
to the length of
torus = FALSE,
world does not need to be provided.
torus = TRUE and the distance from one
its corresponding agent/location
agents2 is smaller around the
sides of the
world than across it, then the direction to the agent/location
agents2 going around the sides of the
world is given to the
If a turtle is facing its own location, its heading does not change.
Wilensky, U. 1999. NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.
w1 <- createWorld(minPxcor = 0, maxPxcor = 4, minPycor = 0, maxPycor = 4, data = runif(25)) t1 <- createTurtles(n = 10, coords = randomXYcor(w1, n = 10)) plot(w1)t1 <- face(turtles = t1, agents2 = cbind(x = 0, y = 0)) t1 <- fd(turtles = t1, dist = 0.5) points(t1, col = of(agents = t1, var = "color"), pch = 16)