Reputation: 1
I have been trying to create average plot of various runs (if possible with their variation).
So far the only way I found was by using the xls from Behavior Space and do it externally.
Is there a way to do this in Netlogo?
Many thanks for your help!
Upvotes: 0
Views: 544
Reputation: 1199
It is possible, but it is not entierly convenient. To get a start you could look at the "Simple Birth Rates" model from the NetLogo models library. In this model, the setup procedure is split up into a basic setup, which is executed once, when the model is initialized for the first time. And then a second "setup-experiment", which is executed in-between multiple runs. This allows you to control, which things get cleared in between runs (turtles, patches, plots, ...).
For performing multiple runs, the model uses a second go-procedure, named go-experiment. This procedure runs the model (go) until a stop condition is true. Then it calls the setup-experiment procedure and continues with the next simulation run (go).
To store data for a plot, you only would need to store the final results of interest of each run in a global list (right after the stop condition became true and right before the setup-experiment of the next run is performed). This can then be used by a plot on your interface to summarize the data of various runs. You only have to make sure, that you dont clear the global variables in your setup-experiment procedure and that your setup-experiment procedure resets all other global variables (if any) to their initial-state.
Upvotes: 2