NetLogo Experiment Setup

Diesel :

I'm working on a model in Netlogo and I'm having a problem understanding how to set up an "experiment". In my model, I have a matrix that has all of the values that I'm interested in (6 in total) and the matrix is updated whenever a condition is met (every time X turtles are killed off) basically capturing a snapshot of the model at that point. The previous values in the matrix are cleared, so the matrix is a 1x6, not a 10000x6 matrix with only one line being updated for each snapshot.

What I would like to do is to set up an experiment to run my model several hundred times, collecting this matrix each time for the first X number of snapshots or until Y ticks have occurred. But I can't see a way to do that in the experiment setup?

Is this possible to do, or would I have to create the 100x6 (100 snapshots) and then just export that matrix to a CSV somehow?

I've never set up an experiment in Netlogo, so this might be super easy to do or just be completely impossible.

JenB :

If I understand your question correctly, then you want 6 values reported at specific ticks during the run. Those ticks are chosen by meeting a condition rather than a certain number of ticks. NetLogo has an experiment management tool called BehaviorSpace. It is straightforward to set up your several hundred runs (potentially with different values for any inputs on sliders etc). It's not so straightforward to only output on certain ticks.

The BehaviorSpace dialogue box has a checkmark for every tick or at the end only. If you have it set to every tick, then you can export your six numbers every tick automatically. In your case, it is likely to be easier to do that than to try and only output occasionally. You could add a seventh reporter that is true/false for whether the matrix is being reset this tick. Then all you have to do in post-processing is select the lines where that seventh reporter is true.

If you want to run the model for exactly N snapshots, then you would also need to set up a global variable that is incremented each snapshot point. Your BehaviorSpace settings would then use that counter for the stop condition.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=368839&siteId=1