I have a model where the male turtles get classified according to a threshold as follows:
ifelse(condition > threshold) [set status 0 ] [set status 1]
I want to count the potential male mates of each of the females in the population who meet this threshold. I've coded it so the females are limited to having a 10-patch radius of detection. If there are no males that meet this threshold then FR should be 0 otherwise it should be a proportion.
ask turtles with [sex = "female"] [if any? turtles with [sex = "male"]
in-radius 10 [ set potentialMates turtles with [sex = "male"] in-radius 10]
ifelse any? potentialMates with [anadromousM = 1]
[set FR count potentialMates with [anadromousM = 1] / count potentialMates ]
[set FR 0]]
When I run this I get the error for the second any?
ANY? expected input to be an agentset but got the number 0 instead.
Where am I going wrong? Hope you can help.