Command Script

Simul8 Command Script lets you write a simple set of commands to run a series of simulations.

The script file (.S8c) is written in Notepad.

It must be saved with an S8c extension.

The example below, when run, will open Simul8 and load the Doctor's clinic demo (installed in default location with Simul8 program files), running it twice and putting each set of results in a file called MyResults.csv. The results file is created by the command and will be located in the same folder as the S8 file.

#Example Simul8 Command Script File
Open c:\Program Files\Simul8\Examples\Others\Demo1.S8
Run
Results MyResults.txt,Default Run
VL SET Nurse.Replication = 2
Run
Results MyResults.txt,With 2 Nurses
Close

Run the script command either through Windows Explorer (double click the S8C file) or through Simul8 using the Run Command Script button on the Advanced tab.

To edit the script file open it with Notepad. Comments can be written with a # at the start.

The complete list of command available:

  • OPEN filename - Opens a simulation.
  • SAVE filename - Save the simulation as filename. If no filename uses OPEN name.
  • CLOSE - close the current file and leave Simul8 open. The file is not saved.
  • QUIT - close Simul8. Any open file is not saved.
  • RUN [time] - Runs to normal end of simulation run or specified time if given (time is ignored if < warm up time). Always does a reset before a run.
  • TRIAL [runs] - Runs a trial (of runs runs if runs specified - otherwise the number preset in the file.
  • RESET - resets the simulation to time zero.
  • GOTO time - Like CTRL-G
  • VL line - Obeys a single line of Visual Logic. Cannot be a control line like IF or RUN
  • AUTORESULTS filename - after every trial (or run) appends results to a results file (txt, csv).
  • AUTORESULTSFULL filename - as AUTORESULTS but include confidence limit from trial results
  • RESULTS filename,name of result - appends results to a results file (txt, csv, RS8). Results exported are the trial or run depending on what has just completed (except RS8) and are the results contained in the KPI Summary. Name of result is the first field on the line. Results come from the KPI Summary.
  • RESULTSFULL filename,name of result - as RESULTS but include confidence limits from trial results.
  • RESULTSCLEAR filename - empty a results file for new appending.
  • TITLE - next set of results (e.g. autoresults) will get this title. Also set this if you use RESULTSHEADER and want space for the title in column 1 even if you are not actually using AUTORESULTS.
  • RESULTSHEADER filename - put a header line in a results file (generated automatically from KPI Summary).

Example

See also