Learn R Programming

NetLogoR (version 0.3.9)

other: Others

Description

Report an agentset of the agents except specific ones.

Usage

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

https://ccl.northwestern.edu/netlogo/docs/dictionary.html#other

Examples

Run this code
# NOT RUN {
# 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

# Turtles
t1 <- createTurtles(n = 10, coords = cbind(xcor = 0, ycor = 0))
t2 <- other(agents = t1, except = turtle(t1, who = 0))
NLcount(t2) # 9 turtles


# }

Run the code above in your browser using DataLab