I'm trying to vary the global variables - 'experience' and 'involvement' both from 10 to 90 using BehaviorSpace. I then use these variables to set individual turtle involvement (cit-inv) and experience (cit-inv) values. r/NetLogo - BehaviorSpace sweep issue - need help!
However, when I run BehaviorSpace, it doesn't cycle through the values and the global variables stay at 0 for the 81 runs. ie: cit-inv and cit-exp just vary randomly from 0 - 10 based on the random part of the code.
I'm happy to share other code snippets or add more context if that'll help. I guess it's worth noting that I don't explicitly assign any values to 'experience' or 'involvement' in the main body of the code.
Thanks for reading and any suggestions!
In behaviorspace:
["experience" [10 10 90]]
["involvement" [10 10 90]]
Main code:
globals [rain involvement experience]
to setup-involvement-expertise-links
ask ssystems [
set cit-exp ((experience) + random(10))
set cit-inv ((involvement)+ random(10))]
ask lim-ssystems [
set cit-exp ((experience) + random(10))
set cit-inv ((involvement)+ random(10))]
Edit: Leaving this up as a possible alternative, but see Jasper's answer for an explanation of the actual cause of this issue along with a more proper approach rather than a workaround.
I've run into this before, and although the BehaviorSpace documentation says
I've never been able to make
globalvariables, as defined in the Code tab, work in BehaviorSpace. My solution for a quick fix would be to just add two Input widgets to your interface to declare your variables of interest and remove the declaration from your Code tab. That got me from 0 outputs to the expected with this toy code: