    

 ## On this page

  

 

 # Start a simulation 

 Last update: 16.07.2025 

The `simfwk_cli` is the main entrypoint to the user for execution of the simulation framework with given inputs and output. It provides ground truth generator, traffic participant model, kpi evaluator and kpi logger as default components. After simulation is executed, a detailed trace of scenario and the kpi value, min ttc (time-to-collision) will be outputed.

You can pass different args as option to config the simulation:

usage:

 &lt;executable&gt; options

 

where options are:

-?, -h, --help Display usage information

 -v, --version Prints application version information

 -s, --scenario Mandatory argument to specify the scenario to execute

 -o, --output Mandatory argument to specify the output file path for evaluation

 -d, --scheduling Mandatory argument to specify the scheduling configuration for your simulation

 -j, --job_id Optional argument to tag the simulation execution by a given job_id in string

 -c, --cli_enable Optional argument to specify if the cli client should be enabled

 -w, --cli_server Optional argument to specify the CLI server IP address

 -p, --cli_client Optional argument to specify the CLI client IP address

 -u, --user-settings-file Optional argument to specify the user settings of default GT Gen 

 -x, --driver-input-file Optional driver input file to be used by driver module

 -t, --timeout Optional argument to specify event timeout in milliseconds, default is 60000 milliseconds (60s)



where `-s <scenario.xosc>` , `-d, --scheduling <sim_config.json>` and `-o, --output <output_folder>` are mandatory args.

## <a class="anchor" id="autotoc_md1"></a>Simple usage

simfwk cli could be executed by using command:

./simfwk_cli &lt;with options above&gt;



e.g. if you want to execute the scenario and simply have the output, you can run

./simfwk_cli -s your_scenario.xosc -o your_output_path -d your_sim_config.json



## <a class="anchor" id="autotoc_md2"></a>Advanced usage

additionally, you can trigger the cli controller mode by option `-c true`

./simfwk_cli -s your_scenario.xosc -o your_output_path -d your_sim_config.json -c true



this enables the user control of simulation framework, instead of just running through of your scenario. With the `cli controller` , the user can send commands like `run` , `pause` , `resume` , `restart` , `step` or `kill` , to interact with simulation.

### <a class="anchor" id="autotoc_md3"></a>Interact with simulation using cli\_controller

When the `-c true` is applied, a server will be created for listening to the user command. To control the simulation, following command are available:

./cli_controller &lt;user command&gt;



supported commands:

[run] : trigger the execution the simulation, it will continue running til simulation is done

[step] : step the simulation for given count. e.g. "step 5" for stepping simulation for 5 [time](namespacetime.xhtml) default for 1 [time](namespacetime.xhtml)

[pause] : pause the simulation and waiting for user command

[resume] : resume the simulation

[kill] : kill the program

[restart] : restart simulation from initial state and wait for user command

[help] : display usage information



## <a class="anchor" id="autotoc_md4"></a>Example

- First start your simultion and enable user control

./simfwk_cli -s your_scenario.xosc -o your_output_path -d your_sim_config.json -c true



- Then you will see following message in console, if default controller port is not changed

[LogDebug][Cli] simulation with cli controller is enabled! Trying to start simulation with setup and connect with simfwk core server at IP address0.0.0.0:50051 with client at IP addresslocalhost:50051

SimfwkCliServer started: listening on IP 0.0.0.0:50051



- Open a new terminal, and try trigger the simulation

./cli_controller run



- After succeed execution, the console prints `Cli Controller Executation Status OK!` . Then you can see the simulation has been started.

[LogDebug][CliCommandProcessor] received action from cli controller 

[LogInfo][SimRunner] Starting simulation.



**Note: In this control mode, the simulation process `simfwk_cli` will not terminate unless you send `kill` from the cli\_controller or manually send `ctrl+c`**