menu
info Documentation

Scripts

D2S2 can execute scripts that predefine or automate sequences within the simulator. These scripts are packaged together with plugins. This section of the documentation focuses on running scripts from the D2S2 user interface. The Run Script window, shown in Figure 1, is accessed by pressing the Run Script button.

Figure 1: The Run script window displaying the available scripts.

This window opens with the available scripts listed on the left. In Figure 1, the list is empty because the standard version of the simulator does not include any scripts or plugins. Detailed documentation on scripts associated with specific plugins will be provided in the respective plugin documentation.

Script options

The behaviour of scripts can be influenced through options. Each script defines its own set of options. Changes are made to the Options section in the Run Script window, prior to running the script.

Running scripts

To run a script, press the button. The operations that a script execute can vary. It is possible for a script to make modifications to the current model (add or remove model objects), make adjustments to model input properties, and it is possible to run a simulation as part of script execution. The script can also reset and re-run the simulation multiple times, typically with modification to input properties inbetween simulation runs. The above modifications to model and model input properties require that the simulation is in the Reset state, so care must be taken what state the UI is in, before running a script. When a simulation is run inside a script, the currently configured simulation run settings, as specified in the Simulation Settings window, will be used.

Script execution can be stopped using the Reset simulation button. Whenever a script is run, its output and status messages will appear in the Script Output, as shown in Figure 2.

Figure 2: The Script Output view.