NLany: Any agents?

Description Usage Arguments Value Author(s) References See Also Examples

Description

Report TRUE if agents is non empty, report FALSE otherwise.

Usage

1
2
3
4
NLany(agents)

## S4 method for signature 'matrix'
NLany(agents)

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.

Value

Logical. TRUE if there is at least one patch or one turtle in the agents, FALSE otherwise.

Author(s)

Sarah Bauduin

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#any

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Patches
w1 <- createWorld(minPxcor = 0, maxPxcor = 4, minPycor = 0, maxPycor = 4)
p1 <- noPatches()
p2 <- patch(w1, 0, 0)
NLany(p1)
NLany(p2)

# Turtles
t1 <- createTurtles(n = 10, coords = randomXYcor(w1, n = 10))
t2 <- noTurtles()
NLany(t1)
NLany(t2)

NetLogoR documentation built on July 10, 2021, 5:06 p.m.