Stella Simulator takes the full set of arguments available when Stella is called from the command line as described in Running Models Using the Command Line (except -s as Stella Simulator will not change a model file it is given). It also takes a number of arguments specific to Stella Simulator to help with programmatic interaction. For completeness, all of the arguments and their meaning are described here.
Note If you specify arguments that Stella Simulator can't parse, you will receive an error message and a full list of valid arguments.
Set the variable specified in arg to the value of 0 in all model runs. This value will take precedence over any change that might occur in import files, unless the import file is marked Set Parameters and the variable is a constant.
You can specify multiple variables using -0 but each must be preceded by -0 (for example, -0 a -0 b -0 c).
Set the variable specified in arg to the value of 1 in all model runs. This value will take precedence over any change that might occur in import files, unless the import file is marked Set Parameters and the variable is a constant.
You can specify multiple variables using -1 but each must be preceded by -1 (for example, -1 a -1 b -1 c).
When exporting data swap the comma (,)(which becomes the decimal character) and the dot (.) which becomes the thousands delimiter. This will allow the generated files to work on computers that are using this convention and applies to both csv and excel files.
This will delay Simulator by arg seconds (should be a positive number) after each run. Use this for timed execution of runs that are tied to animation or another presentation based requirement or to allow other processes to be completed. By default, there is no delay between run executions.
This argument can also be used to set the timeout for the handshake file interaction (the -h option). When used in combination this way it represents the maximum wait time before proceeding even if the handshake file is not updated.
Causes Simulator to wait for a handshake confirmation at the end of each run. The handshake is done by updating the file named by arg. This file must exist or this option will be ignored.
At the end of each run Simulator will empty the content of the file (leave a file of size 0) and wait for the file to change to a nonzero size before proceeding.
Writing anything into the handshake file (for example, 1) will cause the next run to occur.
Note Writing a value of **#** (and nothing else such as a new line) will stop the current run (and continue with the next if multiple runs have been specified).
If the -d option is used then Simulator will wait no more than that amount of time before proceeding. If the -d option is not specified there is no timeout, Simulator will simply wait till the file is updated, or the process is killed.
If -i is specified than imported files that are enabled, but marked On Demand (see Import Data dialog box) will be imported before each run. This would have the same effect as marking the links Dynamic.
If -ld is specified, data from filename will be loaded as a run. If the file is an Excel file specify a sheet by enclosing its name in parentheses(e.g. mydata.xlsx(Sheet1)). If the sheet name is omitted the first sheet will be used. The data will be loaded as a run and given the same name as the file name. If a run with that name already exists, it will be overwritten. This option can be quite useful when performing calibration as it allows you to update the calibration data without reopening the model in Stella Professional or Architect.
Causes Simulator to compute loop scores and then write them to a csv files. The argument should be a file name with full path, or in the directly simulator is called from. If it does not end in .csv then .csv will be appended. The file will contain loop scores as they are presented in the Loops Panel but with the values at each time shown rather than a composite score. The list will not be sorted, and if there are multiple loop sets in the model the labels will be prefixed by the loop set number as in "Loopset 1 B1".
The list of variables in each loop will be written to the a file with _defs appended (so that if you specify loopscore.csv as the file loopscore_defs.csv will contain the definition. This is simply a comma separate list of the elements in the loop. Normally these are variable names, but if a loop uses internal variables (for example from a DELAY function) or goes through a macro they will be marked differently. The labels for the different loops will match those in the file containing the scores and will be written in the same order.
This is used only when the -ltm option is specified. It allows you to vary the number of loops that will be detected by the exhaustive search method before switching to an approximate algorithm as described in Loop Discovery. The default is 1000.
Cause the run progress to be paused at the interval specified by arg. You can use 0 to cause a pause every DT or any other value. If -p is not given the simulation will not pause (except based on -pe as noted below).
Note The pause interval set in the run specifications for the model is ignored by Simulator.
Note If you set a pause interval but not the -pd or -ph arguments the run will continue without actual pausing. The only effect of the pause will be to have exports executed during the model run instead of at the end of the run.
This will delay Simulator by arg seconds (should be a positive number) after each pause. Use this for timed execution of runs that are tied to animation or another presentation based requirement or to allow other processes to be completed. By default, there is no delay after a pause (effectively no pause) unless the -ph argument is used.
This argument will most commonly be used to set the timeout for the pause handshake file interaction (the -ph option). When used in combination this way it represents the maximum wait time before proceeding even if the handshake file is not updated.
This will cause events defined in Stella to pause (or stop) the simulation. Use an argument of Model (or m) to trigger events with model based actions and Interface (or i) to trigger events with interface based actions. Of Off (or o) to not trigger any events.
By default, Stella Simulator will not make use of pause information in the model, this includes the pause interval and any events that might case the simulation to pause, or to stop.
Causes Simulator to wait for a handshake confirmation before continuing after a pause. The handshake is done by updating the file named by arg. This file must exist or this option will be ignored.
Each time a run is paused, Simulator will empty the content of the file (leave a file of size 0) and wait for the file to change to a nonzero size before proceeding.
Writing anything into the handshake file (for example, 1) will cause the run to resume. Writing a value of **#** (and nothing else such as a new line) will stop the current run.
If the -pd option is used then Simulator will wait no more than that amount of time before proceeding. If the -d option is not specified there is no timeout, Simulator will simply wait till the file is updated, or the process is killed.
By default, Simulator will proceed directly after a pause waiting only if -d is specified.
Causes the run to be paused after values have been initialized, but before time has moved forward from the start time. If, for example, the model has a DT of 0.5 then a pause interval of 0 will pause at time 0.5, 1.0, 1.5 and so on. Using -pi in addition will cause the pauses to occur at 0, 0.5, 1.0, 1.5 and so on.
Causes the run to be paused after values have been initialized, but then restarts (instead of resuming) after the handshake occurs or pause wait time elapses. This allows, for example, the initial values of stocks to be set after the pause occurs. In other respects it behaves the same as the -pi option.
Use this to have Simulator write out a Status file every time a run pauses or is completed. Provide the name of the status file in arg.
The status file is a tab delimited file containing information about the state of the simulation. For example:
State: Paused
Time: 5.25
RunCount: 0
Event1: From: varname Text: pause at 5 from model
State: specifies the state the model is in. The value will be either Paused or Stopped.
Time: shows the time at which the simulation paused or stopped.
RunCount: show the number of runs the preceded the current run (the same as the RUNCOUNT Builtin).
Event1: shows the action for the simulation event that was triggered. This will only be present if the simulation paused or stopped because of a simulation event. If there are multiple actions there may be an Event2, Event3 and so on. Following the event number is From: followed by the name of the variable that triggered the event. After that the event action type is displayed. This will be one of Text, Image or Video.
Text indicates that the action is a text display. The text that would be displayed will follow.
Image indicates that the action is the display of a picture. The name (usually with path) of the image file that would be displayed will follow.
Video indicates that the action is the display of a video. The name (usually with path) of the video file that would be displayed will follow.
Minimize the amount of output that is sent to the console. Error messages will still be shown.
For consistency with desktop Stella this command is recognized, but does not change behavior so can be omitted. In desktop Stella you can omit the -r and have the use the command line simply open a model, but such behavior is not meaningful for Stella Simulator.
This will run the model the number of times specified in arg (which should be a positive integer). If combined with the -h argument a handshake file will be used between each run (but not before the first run).
This will run the model using optimization (the equivalent of O-Run in the desktop software). This will only work if optimization has been set up in the model (see Outcome Optimization). It is not consistent with any of the pause options which will simply be ignored. If you want to use optimization results in a subsequent simulation you will need to call Stella Simulator a second time with different options.
This will run sensitivity on the model. This will only work if sensitivity has been set up in the model (see Sensitivity Analysis). It is not consistent with any of the pause options which will simply be ignored.
If -s is specified than the data (.isdb file) will be saved when Stella Simulator completes. This is useful for sensitivity, where multiple runs will be saved , and optimization, where the final run or multiple runs will be saved.
If -x is specified than exported files that are enabled, but marked On Demand (see Export Data dialog box) will be exported after each run. This would have the same effect as marking the links Dynamic.
For examples of using some of these arguments see Stella Simulator Use Examples.