The most important piece of unfinished business in the GridSweeper design is what exactly the command-line interface will look like. It’s funny—I grew up on an old-school Mac, scoffing at my primitive DOS-using fourth-grade schoolmates. What an awful way to interact with a computer: remember arcane commands and type them in! But as soon as you start doing software development, or system administration, or anything that needs to be automated, the command line is often more efficient.
I have the same goal for the GridSweeper command-line tools as for the graphical interface: make it easy to run parameter sweeps of models. More accurately, make the most common types of parameter sweeps very easy to do; and make other types of sweeps possible, and as easy as possible.
Scenario 1: Multiple Parameters, Ranges, All Combinations
The most common usage scenario is to vary one or more parameters, and run the model one or more times for each combination of parameters. So if there are 3 parameters being varied, each with 4 different values, and the model is being run 10 times with different random seeds, there will be total of 4 x 4 x 4 x 10 = 640 runs.
Let’s say a model has three parameters, beta, gamma, and nu. Beta will go from 0.3 to 0.6 in increments of 0.1; gamma from 1.0 to 1.3; and nu from 0.1 to 0.4. The model will be run 10 times with different random seeds. Let’s say the
The syntax will go something like this:
grepast mymodel -n10 beta=0.3:0.1:0.6 gamma=1.0:0.1:1.3 nu=0.1:0.1:0.4
A breakdown of the pieces:
-
grepastwill be a tool that just calls “gridsweeper repast”, telling the gridsweeper tool that this is a repast model, so the parts of the process that need to be handled by the repast plug-in will be. -
mymodelsays to use mymodel.jar in the current directory. If there’s a shared filesystem (this will be settable in a configuration file or in the GUI), nothing will be transfered over the network except the complete path to the file; if FTP is being used, this file will be staged to the FTP server before running the job, and downloaded by the job on the execution machines. -
beta=0.3:0.1:0.6etc. are the key: you can specify ranges of values with super-simple syntax: [start]:[increment]:[end].
Scenario 2: Multiple Parameters, Specified Values, All Combinations
Sometimes you don’t want to specify ranges & increments, but simply particular combinations of values. You’ll be able to specify a vector of values using commas:
grepast mymodel -n10 beta=0.1,0.4,0.7 gamma=1.0,1.4,1.9
Or, if you want, you can mix range/increment lists with specific values:
grepast mymodel -n10 beta=0.1:0.1:0.5,0.7,1.3
Scenario 3: Multiple Parameters, Specific Combinations
Another common need is to run certain combinations of parameters, but not others. For example, beta=0.3/gamma=0.5 and beta=0.4/gamma=0.6, but not beta=0.3/gamma=0.6. This is accomplished by separating parameter names with semicolons (quotes inserted so the shell sees the whole thing as one argument):
grepast mymodel -n10 "beta;gamma = 0.3;0.5, 0.4;0.6"
If you’d rather specify lists of values with all beta values together and all gamma values together, that’s fine too—just remember that commas separate parameter values for a particular parameter; semicolons separate values for different parameters:
grepast mymodel -n10 "beta;gamma = 0.3,0.4; 0.5,0.6"
Extending this a step further, you’ll be able to combine range/increment lists with this syntax:
grepast mymodel -n10 "beta;gamma = 0.3:0.1:0.6; 0.6:0.1:0.9"
is equivalent to
grepast mymodel -n10 "beta;gamma = 0.3;0.6, 0.4;0.7, 0.5;0.8, 0.6;0.9"
and to
grepast mymodel -n10 "beta;gamma = 0.3,0.4,0.5,0.6; 0.6,0.7,0.8,0.9"
This is as much complexity as command-line syntax will support, though. Beyond this, it’s probably time to use a control file anyway (to be covered in a later post).
Hi!
I would like extend my SQL capabilities.
I red that many SQL books and want to
get more about SQL for my occupation as oracle database manager.
What would you recommend?
Thanks,
Werutz