Tick Reporter For Breed Color Transformation

Viewed 24

I am trying to create a reporter for when the first transformation of one ant breed from one color to another color (violet) occurs, but I have no idea what code to use. My attempt (in a monitor) brings up the END expected error, which is incorrect, but it is probably just signalling some other code error.

to-report group-recruitment-initiation
let potential-recruiter followers with [color = violet]
if any? potential-recruiter
  report ticks
end

Thanks!!

1 Answers

Without testing it, I can see two problems. First report ticks should have brackets around it. Second, if the if condition is false, then the reporter will hit the end statement without reporting anything, which NetLogo will see as an error. Reporting -1 in such a case would make NetLogo happy, but you'll need to think about what that will mean for your monitor.

Related