with1.0

agentset with [reporter]

Takes two inputs: on the left, an agentset (usually "turtles" or "patches"). On the right, a boolean reporter. Reports a new agentset containing only those agents that reported true -- in other words, the agents satisfying the given condition.

show count patches with [pcolor = red]
;; prints the number of red patches

Take me to the full NetLogo Dictionary