1

I would like to know whether is it possible in NetLogo to set the random-seed according to the number of repetitions in the Behavior Space.

I know there is the command random-seed behaviorspace-run-number, but it sets a different seed for every run of the model. This is not what I want because I am trying to explore the impact of a variation in the values of a parameter on a specific random network structure. By using random-seed behaviorspace-run-number I get a different network structure for each value of the parameter within the same repetition of the experiment, which is not what I want.

Can anyone help me on this?

Thanks a lot,

Emanuele

1 Answers1

2

There's not a variable that gives you exactly what you want, but BehaviorSpace runs through the parameter sets in a specific order. Say you have 5 repetitions of 20 parameter combinations, so there's 100 runs. It will do the first run of 20 combinations, then the second series etc. So you can do some mathematics or some if/then to go from the behaviorspace-run-number to the random-seed (eg floor behaviorspace-run-number / 20 if you want it to change every 20 runs).

JenB
  • 17,620
  • 2
  • 17
  • 45
  • Thanks a lot @JenB. I have only 1 parameter which takes 101 different values every repetition, so what I need is that it changes the random seed every 101 runs. I followed your suggestion by doing `floor behaviorspace-run-number / 20` but the seed changes every 100 run instead of 101. I was wondering how if there is a way to modify this simple line of code to make ti change it correctly – Emanuele Citera May 21 '20 at 02:45
  • 1
    `behaviorspace-run-number` starts at 1 and you want it to change at 102, 203 etc. So what you need is `floor (behaviorspace-run-number - 1) / 101`. – JenB May 21 '20 at 08:00
  • Oh that's right. I completely forgot about it. Now it works perfectly! Thanks a lot @JenB, I really appreciate your help – Emanuele Citera May 21 '20 at 16:33