Sound of Speed
Sound of Speed

Reputation: 61

NetLogo - How to see the number of patches that contain turtles

This seems like it should be very simple and have a primitive command for, however I cannot seem to find one in the netlogo dictionary.

I just want to report back a number, which is the number of patches which have one or more turtles on.

I thought about using the "turtles-here" command, but that returns an agentset rather than something I could use such as a boolean or value.

Anyone know a way of doing this?

Upvotes: 2

Views: 228

Answers (1)

Nicolas Payette
Nicolas Payette

Reputation: 14972

Simply:

count patches with [ any? turtles-here ]

Upvotes: 1

Related Questions