Stella Simulator Use Examples

Stella Simulator can be used for a variety of purposes as described in Stella Simulator and Stella Simulator Arguments

The following example assume you have put Stella Simulator in your path, or that you are in the Stella Simulator directory. If this is not the case replace stella_simulator with the full path as in

c:\StellaSimulator\stella_simulator

or

~/StellaSimulator/stella_simulator

Run a model once

stella_simulator modelname.stmx

This command will simply run the model once. If there are active import files they will be read, and if there is are active export files they will be written.

Run a model multiple times waiting between

stella_simulator modelname.stmx -rn 5 -h hs.txt

This will run the model 5 times, waiting after each run for hs.txt to be updated. You can write a routine that monitors hs.txt, gets exported results information, makes changes to input files, then updates hs.txt. This will allow your program to respond to changes in results.

Run a model interactively

stella_simulator modelname.stmx -p 1 -ph hs.txt

This will run the model pausing every time period. At the beginning of the pause exports will be performed. As soon as hs.txt is touched (usually just by writing 1 to it), any active imports will be performed and the simulation continue for another time period (could be multiple DTs). This allows you to set values of inputs in response to output value changes during a simulation.

Run a model responding to simulation events

stella_simulator modelname.stmx -ph hs.txt -ps status.txt -pe Model

This will run the model with any events in the model kept active. When an event triggers, the event content will be written to status.txt and the run paused. Once hs.txt is updated the run will resume.

Calibrate a model with updated data

stella_simulator modelname.stmx -ro -ld reference_data.csv

You will need to have set up modelname to have optimization active with a calibration payoff that references data in the run named "reference_data". You will also need to provide both the .stmx file and the .isdb file in the same directory. When stella_simulator starts it will first replace the run reference_data with whatever is imported from reference_data.csv, and then perform the calibration.