Jack
Jack

Reputation: 1437

Netlogo - Dynamically change the running time per experiment using Behavior Space

I am running a model multiple times from behavior space. Each time the running length of time needs to be different according to the data imported from the external data source (e.g. the ending time of the last shift of production during a typical day). How to do this in behavior space?

Upvotes: 1

Views: 102

Answers (1)

Jasper
Jasper

Reputation: 2790

You can manually limit the length of a run using the Stop condition in your BehaviorSpace experiment. You'll need a global to track the number of ticks to run, and then you'll need to populate it in the setup portion of your model:

globals [ ticks-to-run ]

to setup
  reset-ticks
  set ticks-to-run random 150 ; replace `random 150` by the data you load from your external source
end

to go 
  tick
end

This assumes you're running setup in your Setup commands and go in your Go commands. Then in your Stop condition add ticks > ticks-to-run and your model will stop once it has ticked past your ticks-to-run. Also make sure your Time limit is 0 in this case, as any value there would stop a model run before your custom ticks-to-run limit.

Upvotes: 2

Related Questions