# Patches
w1 <- createWorld(minPxcor = 0, maxPxcor = 4, minPycor = 0, maxPycor = 4,
data = sample(1:5, size = 25, replace = TRUE))
plot(w1)
p1 <- withMax(agents = patches(w1), world = w1)
# Turtles
t1 <- createTurtles(n = 10, coords = randomXYcor(w1, n = 10),
heading = sample(1:3, size = 10, replace= TRUE))
t2 <- withMax(agents = t1, var = "heading")
Run the code above in your browser using DataLab