Reputation: 71
I'm having troubles with my monitors. I want to count the total turtles with a certain variable in patches with another varible, but haven't been able to do it, all I got was erros. Here is what I have:
patches-own [inovations?]
turtles-own [income]
count turtles with [income > 800] on patches with [inovations? = TRUE]
Thank you
Upvotes: 1
Views: 330
Reputation: 2780
A turtle always has access to the variables of the patch which it is on. So you can just do:
count turtles with [income > 800 and inovations? = TRUE]
It's the same reason you can do things like ask turtles [ set pcolor red ]
and count turtles with [ pxcor = max-pxcor ]
even though pcolor
and pxcor
are patch variables.
Upvotes: 2