Report an agentset of the agents except specific ones.

other(agents, except)

# S4 method for matrix,matrix
other(agents, except)

Arguments

agents

Matrix (ncol = 2) with the first column "pxcor" and the second column "pycor" representing the patches coordinates, or

AgentMatrix object representing the moving agents.

except

Matrix (ncol = 2) with the first column "pxcor" and the second column "pycor" representing the patches coordinates, or

AgentMatrix object representing the moving agents.

Value

Matrix (ncol = 2) with the first column "pxcor" and the second column "pycor" representing the patches in agents without the ones in except, or

AgentMatrix representing the turtles in agents without the ones in except.

Details

Both agents and except must be of the same class (e.g., both patches or both turtles).

Warning: this function removes turtles only based on similar "who" numbers and "breed" names.

References

Wilensky, U. 1999. NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL.

See also

Examples

# Patches w1 <- createWorld(minPxcor = 0, maxPxcor = 9, minPycor = 0, maxPycor = 9) p1 <- other(agents = patches(w1), except = patch(w1, 0, 0)) NLcount(p1) # 99 patches
#> [1] 99
# Turtles t1 <- createTurtles(n = 10, coords = cbind(xcor = 0, ycor = 0)) t2 <- other(agents = t1, except = turtle(t1, who = 0)) NLcount(t2) # 9 turtles
#> [1] 9