Search code examples
netlogobehaviorspace

Netlogo reset-ticks error message


.nlogo fileenter image description here

I am getting this error while running iterations using behavior space

The tick counter has not been started yet. Use RESET-TICKS.
error while observer running TICKS
called by procedure __EVALUATOR 

I am not sure why this is happening. I have included reset-ticks in the "set" routine.

In addition in the behavior space dialog wizard, i also included reset-ticks as the final command to be executed. Yet i am getting this error.

Below is my setup and go code:

to setup
  clear-all
  setup-citizens
  setup-parties
  update-support
  reset-ticks

end

to go
  ask parties [ adapt set my-old-size my-size ]
  update-support
  election
  plot-voter-turnout
  plot-volatility
  if (Turnout-100%? = false) [plot-citizen-comparison]

  tick

end

Solution

  • You are using ticks in your BehaviorSpace experiment's "stop condition", so I think it's nearly certain that's where the "error while observer running TICKS" error must be coming from, given that the stack trace doesn't refer to a procedure name.

    Here's my best guess at what's going on here: under some conditions, your setup procedure fails, and therefore never reaches the call to reset-ticks at the end of setup. Then BehaviorSpace tries to run your stop condition, resulting in the error you see.

    This guess has some problems:

    • Why BehaviorSpace would only be showing you the eventual ticks error, and not the error causing setup to fail, I don't know.

    • I have no idea why your setup procedure would be failing.

    Nonetheless, that's the best I can offer you without doing a more in-depth investigation.