Report TRUE
if all agents
have their variable equal to a given value,
report FALSE
otherwise.
NLall(agents, world, var, val) # S4 method for matrix,worldMatrix,missing NLall(agents, world, val) # S4 method for matrix,worldArray,character NLall(agents, world, var, val) # S4 method for agentMatrix,missing,character NLall(agents, var, val)
agents | Matrix (
|
---|---|
world |
|
var | Character. The name of the selected |
val | Numeric or character. Vector of any length. |
Logical. TRUE
if all the agents
have their variable equal to
val
, FALSE
otherwise.
world
must not be provided if agents
are turtles.
Wilensky, U. 1999. NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.
# Patches w1 <- createWorld(minPxcor = 0, maxPxcor = 4, minPycor = 0, maxPycor = 4, data = runif(25)) NLall(agents = patches(w1), world = w1, val = 5)#> [1] FALSEw2 <- w1 w2 <- NLset(world = w1, agents = patches(w1), val = 5) NLall(agents = patches(w2), world = w2, val = 5)#> [1] TRUE# Turtles t1 <- createTurtles(n = 5, coords = cbind(xcor = 1, ycor = 1), heading = c(1, 2, 2, 1, 2)) NLall(agents = t1, var = "xcor", val = 1)#> [1] TRUENLall(agents = t1, var = "heading", val = 2)#> [1] FALSE