I am running experiments with behaviorspace where I need to change global variables in the setup commands section. This does not seem to work. Here is the situation:
I create multiple agent “tribes” in the setup commands section.
Each tribe has some different parameters for its distribution
Each parameter is a global variable
I try to set the parameter in the setup commands section before calling tribe creation procedure.
The value for the parameter being set is a value from a variable that is being varied for the experiment.
I don’t get the varying value for the parameter being set.
However, when I check the parameter in the tribe creation procedure, it is not changed. It is the original value for the experiment.
Is there a different namespace I am changing? If so, how do I change namespace to be the about to be run namespace?
Thanks for any insight you can provide on how to do this.
Moody
I think you may misunderstand the purpose of the setup commands section.
The typical use case is to have it just contain the command setup, which means call the procedure named setup.
The NetLogo procedure you write called setup is the place where the procedure that creates a tribe is called.
The values of the global values are set in the section.
A different set of these values is used each time the commands in the setup commands section are run. You cannot change the value of the global variables there.
Setup commands: These commands will be used to begin each model run. Typically, you will enter the name of a procedure that sets up the model, typically setup. But it is also possible to include other commands as well. If you want the same results each time you run an experiment, you could use something like random-seed 473 setup or to have different results for repetitions random-seed (474 + behaviorspace-run-number) setup
Although it is not stated explicitly the experiments global variables are not available in this section. The NetLogo variable behaviorspace-run-number can be used, as indicated above.
If you still think that BehaviorSpace is not working as intended, please send us a copy of you program indicating how to reproduce the problem.
Hi Aaron,
Thanks for the reply. Here is what I am doing and why I am using the setup section in behaviorspace to do it. If there is a better way, please let me know.
For a given run, I add different agents with different distributions, variables, etc. These variables are sliders, etc (global variables).*
-Once the tribes are populated with the varying parameters. I run the experiment.
I am doing hundreds / thousands of runs at a time in behaviorspace (BS).
This is where I thought I could change the tribe parameters for experiments. I couldn’t figure out how to use the vary variables in BS for different distributions of agents for the same run. For example, for one run I can have 2 (or more) tribes with different distributions, masses, and other agent variables.
I have been able to run these experiments by varying global variables in the BS setup command section. Am I exploiting a feature / bug in the netlogo implementation that allows me to do this?
Thanks again for your help,
Moody
p.s. I have read the doc / user manual several times and looked online to find another way to do this. Have not been successful so far.
Hi Moody,
I have attached a model that might do the sort of thing you want.
The main idea is that a given parameter that represents values for multiple tribes can be expressed as a list
You can represent the step sizes for two tribes for three experiments using
["step-size" [1 1] [1 -1] [1 2]]
then in your code you can have
globals [ step-size step-a step-b ]
to setup
clear-turtles
set step-a item 0 step-size
set step-b item 1 step-size
...
end
and one tribe can use step-a and the other step-b
My model is based on the library model “Breeds and Shapes Example”