Skip to content

Command Line Options ​

The following sections explain the different options available when running EMRALD through the command prompt. Options can be manually specified in the command line or input via a .json file.

Option Flags ​

Flag
Description
-hOpens the "Help" menu
-nSpecifies the number of runs
-iSpecifies the input model file path
-rSpecifies the basic/text results output file path
-oSpecifies the JSON path-results output file path
-tSpecifies the maximum time for each run
-eRuns the simulation
-threadsSpecifies the number of threads to use for parallel execution
-mSpecifies the parameters to monitor. Use brackets for multiple variables.
Example: -m [x y z]
-sSpecifies the initial random number seed
-dSpecifies the debug level, either "basic" or "detailed", and an optional range
Example: -d basic [10 20]
-rIntrvSpecifies how often to save the path results, every X number of runs. No value or <1 will result in saving only after all runs are complete.
-mergeResultsMerges two or more JSON path result files into a single file and estimates the 5th and 95th percentiles. The last path is the destination; all preceding paths are sources.
Example (2 sources): -mergeResults c:/temp/Batch1.json c:/temp/Batch2.json c:/temp/Combined.json
Example (3 sources): -mergeResults c:/temp/Batch1.json c:/temp/Batch2.json c:/temp/Batch3.json c:/temp/Combined.json
-console, -showConsoleAllocates a console window for stdout output when running a Release build of EMRALD_Sim.exe. Debug builds show a console automatically only when launched without arguments. Aliases: -console, -showConsole.
-json-helpPrints the JSON options file syntax to the console (CommandLineCP only).

To run a coupled external simulation (XMPP or WebSocket), configure the connection in the couplingInfo section of the Options JSON file rather than passing it on the command line.

Options JSON File ​

Alternatively, the user may create a dedicated .json file to specify options. This allows the user to prefill and run the simulation with only two arguments in the command line.

> [path/to/EMRALD_Sim.exe] [path/to/options/file]

Fields ​

Field
Type
Description
opsVernumberVersion of the options file format (current: 1.02).
runctintegerTotal number of runs.
inpfilestringPath to the input model file.
resoutstringPath to the basic/text results output file.
jsonResstringPath to the JSON path-results output file.
variablesstring[]Variable names to record in the results.
initVarsobject[]Variables to (re)initialize on each run. Each item is { "varName": "<name>", "value": "<string value>" }. For variables flagged "reset on every run", this value is applied every run; otherwise behavior matches a single initial assignment.
runtimestringMaximum simulation time in Days.HH:MM:SS format (e.g. 365.00:00:00).
seedintegerInitial random number seed.
debugstringDebug level: "basic", "detailed", or "off".
debugStartIdxinteger|nullRun index to start debug logging at. null means from the first run.
debugEndIdxinteger|nullRun index to stop debug logging at. null means through the last run.
pathResultsIntervalintegerHow often (in runs) to write the path results file. Use -1 to write only at the end.
threadsinteger|nullNumber of threads to use for parallel execution. null (default) disables threading. Any value (even 1) uses per-thread temp folders so multiple instances can share the same model.
clearThreadTempsbooleanIf true (default when omitted), per-thread temp files are deleted after a multi-threaded run completes.
couplingInfoobjectExternal coupling configuration. Omit if no coupling is needed. See below.

couplingInfo sub-object ​

Field
Type
Description
couplingTypestring"XMPP" or "WebSocket".
couplingPasswordstringXMPP only. Password for the XMPP connection. Not used for WebSocket.
userstringXMPP only. User name for the XMPP connection. Not used for WebSocket.
couplingURLstring|nullURL to connect to for WebSocket (required). May be null for XMPP.
timeoutintegerConnection timeout in seconds.
logCouplingMsgsbooleanLog coupling messages to the console (debug builds only). Set false to suppress during testing.

Example ​

json
{
  "opsVer": 1.02,
  "runct": 100,
  "inpfile": "c:/models/MyModel.json",
  "resout": "BasicResults.txt",
  "jsonRes": "c:/temp/PathResults.json",
  "variables": [ "var1", "var2" ],
  "initVars": [
    { "varName": "var1", "value": "5" }
  ],
  "runtime": "365.00:00:00",
  "seed": 0,
  "debug": "off",
  "debugStartIdx": null,
  "debugEndIdx": null,
  "pathResultsInterval": 1000,
  "threads": 4,
  "clearThreadTemps": false,
  "couplingInfo": {
    "couplingType": "WebSocket",
    "couplingPassword": "secret",
    "user": "user",
    "couplingURL": "ws://localhost:8080/emrald",
    "timeout": 30,
    "logCouplingMsgs": true
  }
}