Getting results per tick in BehaviourSpace

I have a NetLogo model that runs fine, but I have problems getting the output I need with BehaviourSpace. I have pasted the Behaviour Space window below. I want to be able to plot the values of two variables, “yearly-OHCA” and “count CFRs”, at every tick within each experiment. The experiment should run for 41 ticks (year 2010 to year 2050).

When I run Behaviour Space and sort the results on “Run” + “Step”, I get values that do not make sense. For each run, it seems that the values of the two variables at Step 1 are what they would be at the end of the time horizon (tick 41). Then they decrease.

I am not sure if this is enough information to describe the problem. I’ll be happy to provide any additional information that is needed.

Are you open to sharing your model? I could then run it and see what’s happening.

Hi Jacob,

Thanks for the kind offer!

I attach the model and a data file that you need. The first line in the setup procedure sets the current directory, which you will need to change.

Best regards,
Ashish

(attachments)

OHCA8.nlogo (28.2 KB)
population.csv (2.26 KB)

The issue is that you have a repeat 41 in your go procedure. This is not the standard way to write a NetLogo model. Instead you use a “forever button” for go to have the model keep repeating the go procedure (and have a stop condition if needed). Since you have a repeat 41, when you run BehaviorSpace with a time limit of 41, you are actually running the go procedure 41*41 = 1681 times. You have two options:

  1. Leave your model as is, and change your BehaviorSpace experiment to have a time limit of 1
  2. Use the standard NetLogo way of doing this that I described above (which I’ve done in the attached model - you’ll have to change the directory back) and leave your BehaviorSpace experiment as it is.

OHCA8.nlogo (28.2 KB)

Dear Jacob,

I’ll work on this tonight (I am in Singapore). I am very grateful.

Are you okay with being acknowledged in our conference paper? If yes, can you kindly let me know your full name and affiliation as you would like it to appear?

Best regards,
Ashish

No need to acknowledge me. Good luck on the paper!