The scripting language allows multiple simulations using one or more models, with different parameters, time step settings and so forth for each run. The results can be recorded to a text file, for later analysis, or processed in the script. Several different approaches to meeting this need have been considered, including providing a specific graphic interface such as a new run control. We concluded that scripting allowed the most flexibility and encouraged users to find applications beyond those which we have initially considered.
Commands are provided to control key parts (model window, run control and data table) of the Simile user interface. (Simile is hidden by default.) Program objects are created that have commands (methods) that generally correspond to menu commands or tool buttons in the interactive graphical interface.
Typically, the script interface to Simile is accessed by running the SimileScript application that is provided with Simile. A program object to control the model window is created and then used to load a model and scenario file. A run control object is then created to set time-steps, how long to run the model for, etc, and a data table control object is created to record variables. At the end of the simulation the data table object is used to write values to a file.
The script interface to Simile is accessed by running the SimileScript application that is provided with Simile. Scripts can be pasted in to the window or loaded via the File-->Source menu item. Commands can also be added one at a time. This can be useful to explore the script interface capablities. Some example scripts are included below.
Simile script is an extension to TclTk and the full functionality is available to those that want to use it (see http://www.tcl.tk/).
Four example scripts are included in the Examples directory of the Simile installation.
The scripting is provided by using Tcl and access to the script interface to Simile is available from other Tcl / Tk 8.4 installations by using the SimileAutoObj package. You will have to ensure that SimileAutoObj package is in the package search path. Add the directory system/lib/SimileAutoObj to your other Tcl interpreter rather than copying the directory to your other interpreters lib directory as the SimileAutoObj package requires access to other files in the Simile installation. E.g.,
lappend auto_path {c:/program files/Simile40/system/lib}package require SimileAutoObj