With regards to this question MOVE-TO expected input to be an agent but got NOBODY instead, I regularly encounter the same issue, however, even if I write a move-to
that is protected by an if any?
.
Imagine the following scenario, I have two breed
, and one is ask to approach a member of the other breed if conditions are met. This is what breed1
executes:
if any? breed2 [
ifelse var >= 5 [
move-to one-of breed2 in-radius 2
]
[ ... ]
]
If, breed2 is not in-radius
or no member of breed1 has a var
above 5, I get the above mentioned error message. How can I avoid it?