    

 ## On this page

  

 

 # simulation\_framework::core::SimRunner Class Reference

 Last update: 16.07.2025 

Simulation runner with external control logic. [More...](classsimulation__framework_1_1core_1_1SimRunner.xhtml#details)

`#include <<a class="el" href="sim__runner_8h_source.xhtml">sim_runner.h</a>>`

Inheritance diagram for simulation_framework::core::SimRunner:

![Inheritance graph](/sites/default/files/migrate-content/avxcelerate_simulation_framework_2025_r2_2/classsimulation__framework_1_1core_1_1SimRunner__inherit__graph.png)

\[[legend](graph_legend.xhtml)\]

Collaboration diagram for simulation_framework::core::SimRunner:

![Collaboration graph](/sites/default/files/migrate-content/avxcelerate_simulation_framework_2025_r2_2/classsimulation__framework_1_1core_1_1SimRunner__coll__graph.png)

\[[legend](graph_legend.xhtml)\]

## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

<a id="a86df4168e20485587e74801f5400dda4" name="a86df4168e20485587e74801f5400dda4"></a> **~SimRunner** () Destructor for `<a class="el" href="classsimulation__framework_1_1core_1_1SimRunner.xhtml" title="Simulation runner with external control logic.">SimRunner</a>`.   
  [SimRunner](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a961cc52e44842a326e1fc638a6e6f404) (std::unique\_ptr&lt; [lifecycle::ISimulationInstance](classsimulation__framework_1_1core_1_1lifecycle_1_1ISimulationInstance.xhtml) &gt; [sim\_instance](classsimulation__framework_1_1core_1_1Topic.xhtml)) Constructs a `<a class="el" href="classsimulation__framework_1_1core_1_1SimRunner.xhtml" title="Simulation runner with external control logic.">SimRunner</a>` with a simulation instance.   
 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) [Run](classsimulation__framework_1_1core_1_1SimRunner.xhtml#aa47196cb107ebc1c200ab5fd43fc22f9) () [override](classsimulation__framework_1_1core_1_1Topic.xhtml) Executes the simulation and changes the state to `kRunning`.   
 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) [Pause](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a2008706db821aed76b79bee747a220ac) () [override](classsimulation__framework_1_1core_1_1Topic.xhtml) Pauses the simulation.   
 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) [Resume](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a0bc52ce914b51ce4fc709b0686d05475) () [override](classsimulation__framework_1_1core_1_1Topic.xhtml) Resumes the simulation.   
 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) [StepN](classsimulation__framework_1_1core_1_1SimRunner.xhtml#aa2aecf086a4535c9a4d05b977deb29f3) ([int](classsimulation__framework_1_1core_1_1Topic.xhtml) [n](classsimulation__framework_1_1core_1_1Topic.xhtml)) [override](classsimulation__framework_1_1core_1_1Topic.xhtml) Steps the simulation forward by a specified number of frames.   
 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) [Stop](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a122aef144fa4620085078b7ef1d58645) () [override](classsimulation__framework_1_1core_1_1Topic.xhtml) Stops the simulation immediately.   
 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) [Terminate](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a6b54a3a3676bc74deea17f50910c3e5b) () [override](classsimulation__framework_1_1core_1_1Topic.xhtml) Terminates the simulation.   
 SimState [GetSimulationState](classsimulation__framework_1_1core_1_1SimRunner.xhtml#ab5f6d34b0bbd35000cfff95bcfeb901f) () [const](classsimulation__framework_1_1core_1_1Topic.xhtml) Retrieves the current state of the simulation.   
 [uint64\_t](classsimulation__framework_1_1core_1_1Topic.xhtml) [GetExecutedStepCount](classsimulation__framework_1_1core_1_1SimRunner.xhtml#ab7b56bf2aa50f1ca9b14b928268939eb) () [const](classsimulation__framework_1_1core_1_1Topic.xhtml) Retrieves the number of executed simulation steps.   
 [void](classsimulation__framework_1_1core_1_1Topic.xhtml) [RunOverSimulation](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a4ba901d04097297295b7b680ac151da9) () [override](classsimulation__framework_1_1core_1_1Topic.xhtml) Runs the simulation until it ends without accepting further commands.   
 ![-](/sites/default/files/migrate-content/avxcelerate_simulation_framework_2025_r2_2/closed.png) Public Member Functions inherited from [simulation\_framework::core::ISimRunner](classsimulation__framework_1_1core_1_1ISimRunner.xhtml)[virtual](classsimulation__framework_1_1core_1_1Topic.xhtml) **~ISimRunner** ()=[default](classsimulation__framework_1_1core_1_1Topic.xhtml) Virtual destructor for proper cleanup of derived classes.   
 <a id="details" name="details"></a>## Detailed Description

Simulation runner with external control logic.

The `<a class="el" href="classsimulation__framework_1_1core_1_1SimRunner.xhtml" title="Simulation runner with external control logic.">SimRunner</a>` class implements the `<a class="el" href="classsimulation__framework_1_1core_1_1ISimRunner.xhtml" title="Interface for controlling and managing simulation execution.">ISimRunner</a>` interface and provides methods to control the flow of a simulation, including starting, pausing, stepping, and terminating it. Internally, it delegates these operations to a `SimRunnerImpl` object.

See also[ISimRunner](classsimulation__framework_1_1core_1_1ISimRunner.xhtml "Interface for controlling and managing simulation execution."), [lifecycle::ISimulationInstance](classsimulation__framework_1_1core_1_1lifecycle_1_1ISimulationInstance.xhtml "class ISimulationInstance")Definition at line [26](sim__runner_8h_source.xhtml#l00026) of file [sim\_runner.h](sim__runner_8h_source.xhtml).



## Constructor &amp; Destructor Documentation

<a id="a961cc52e44842a326e1fc638a6e6f404" name="a961cc52e44842a326e1fc638a6e6f404"></a>## [◆ ](#a961cc52e44842a326e1fc638a6e6f404)SimRunner()

 simulation\_framework::core::SimRunner::SimRunner  ( std::unique\_ptr&lt; [lifecycle::ISimulationInstance](classsimulation__framework_1_1core_1_1lifecycle_1_1ISimulationInstance.xhtml) &gt;  *sim\_instance*)   explicit 

Constructs a `<a class="el" href="classsimulation__framework_1_1core_1_1SimRunner.xhtml" title="Simulation runner with external control logic.">SimRunner</a>` with a simulation instance.

Parameters sim\_instanceA unique pointer to the simulation instance to control. 



## Member Function Documentation

<a id="ab7b56bf2aa50f1ca9b14b928268939eb" name="ab7b56bf2aa50f1ca9b14b928268939eb"></a>## [◆ ](#ab7b56bf2aa50f1ca9b14b928268939eb)GetExecutedStepCount()

 [uint64\_t](classsimulation__framework_1_1core_1_1Topic.xhtml) simulation\_framework::core::SimRunner::GetExecutedStepCount  ( )  const  virtual 

Retrieves the number of executed simulation steps.

The step counter resets if the simulation is restarted.

ReturnsThe number of executed simulation steps. Implements [simulation\_framework::core::ISimRunner](classsimulation__framework_1_1core_1_1ISimRunner.xhtml#ae60fbe830aef619e8cbd39a092f1f995).





<a id="ab5f6d34b0bbd35000cfff95bcfeb901f" name="ab5f6d34b0bbd35000cfff95bcfeb901f"></a>## [◆ ](#ab5f6d34b0bbd35000cfff95bcfeb901f)GetSimulationState()

 SimState simulation\_framework::core::SimRunner::GetSimulationState  ( )  const  virtual 

Retrieves the current state of the simulation.

ReturnsThe current simulation state as a `SimState` enum value. Implements [simulation\_framework::core::ISimRunner](classsimulation__framework_1_1core_1_1ISimRunner.xhtml#a66d4287f6da13af21331fbfc1c5ff226).





<a id="a2008706db821aed76b79bee747a220ac" name="a2008706db821aed76b79bee747a220ac"></a>## [◆ ](#a2008706db821aed76b79bee747a220ac)Pause()

 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) simulation\_framework::core::SimRunner::Pause  ( )   overridevirtual 

Pauses the simulation.

If the simulation is in the `kRunning` state, it transitions to the `kPaused` state.

ReturnsA `<a class="el" href="structsimulation__framework_1_1core_1_1StateFeedback.xhtml" title="Represents feedback for the execution status of a control command.">StateFeedback</a>` object containing the status of the pause operation. Implements [simulation\_framework::core::ISimRunner](classsimulation__framework_1_1core_1_1ISimRunner.xhtml#a7cc05d7d61c4cb7af9eca9fb85bce8d7).





<a id="a0bc52ce914b51ce4fc709b0686d05475" name="a0bc52ce914b51ce4fc709b0686d05475"></a>## [◆ ](#a0bc52ce914b51ce4fc709b0686d05475)Resume()

 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) simulation\_framework::core::SimRunner::Resume  ( )   overridevirtual 

Resumes the simulation.

The simulation state changes from `kPaused` back to `kRunning`.

ReturnsA `<a class="el" href="structsimulation__framework_1_1core_1_1StateFeedback.xhtml" title="Represents feedback for the execution status of a control command.">StateFeedback</a>` object containing the status of the resume operation. Implements [simulation\_framework::core::ISimRunner](classsimulation__framework_1_1core_1_1ISimRunner.xhtml#a4b448f77a70ea37643cff04f6d1c7c1c).





<a id="aa47196cb107ebc1c200ab5fd43fc22f9" name="aa47196cb107ebc1c200ab5fd43fc22f9"></a>## [◆ ](#aa47196cb107ebc1c200ab5fd43fc22f9)Run()

 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) simulation\_framework::core::SimRunner::Run  ( )   overridevirtual 

Executes the simulation and changes the state to `kRunning`.

The simulation runs until the scenario ends unless paused or stopped by the user.

ReturnsA `<a class="el" href="structsimulation__framework_1_1core_1_1StateFeedback.xhtml" title="Represents feedback for the execution status of a control command.">StateFeedback</a>` object containing execution status and error information, if any. Implements [simulation\_framework::core::ISimRunner](classsimulation__framework_1_1core_1_1ISimRunner.xhtml#ab7615f9b015b1c52e3af9e21ef2bf6ee).





<a id="a4ba901d04097297295b7b680ac151da9" name="a4ba901d04097297295b7b680ac151da9"></a>## [◆ ](#a4ba901d04097297295b7b680ac151da9)RunOverSimulation()

 [void](classsimulation__framework_1_1core_1_1Topic.xhtml) simulation\_framework::core::SimRunner::RunOverSimulation  ( )   overridevirtual 

Runs the simulation until it ends without accepting further commands.

Implements [simulation\_framework::core::ISimRunner](classsimulation__framework_1_1core_1_1ISimRunner.xhtml#af5cc40c4bdd9360cd2e95e1c2f8e5626).





<a id="aa2aecf086a4535c9a4d05b977deb29f3" name="aa2aecf086a4535c9a4d05b977deb29f3"></a>## [◆ ](#aa2aecf086a4535c9a4d05b977deb29f3)StepN()

 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) simulation\_framework::core::SimRunner::StepN  ( [int](classsimulation__framework_1_1core_1_1Topic.xhtml)  *n*)   overridevirtual 

Steps the simulation forward by a specified number of frames.

Parameters nThe number of simulation steps to execute. ReturnsA `<a class="el" href="structsimulation__framework_1_1core_1_1StateFeedback.xhtml" title="Represents feedback for the execution status of a control command.">StateFeedback</a>` object containing the status of the step operation. Implements [simulation\_framework::core::ISimRunner](classsimulation__framework_1_1core_1_1ISimRunner.xhtml#a11b61afe9fa80c71aae36c16449ac831).





<a id="a122aef144fa4620085078b7ef1d58645" name="a122aef144fa4620085078b7ef1d58645"></a>## [◆ ](#a122aef144fa4620085078b7ef1d58645)Stop()

 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) simulation\_framework::core::SimRunner::Stop  ( )   overridevirtual 

Stops the simulation immediately.

The simulation state resets to `kInitialized`.

ReturnsA `<a class="el" href="structsimulation__framework_1_1core_1_1StateFeedback.xhtml" title="Represents feedback for the execution status of a control command.">StateFeedback</a>` object containing the status of the stop operation. Implements [simulation\_framework::core::ISimRunner](classsimulation__framework_1_1core_1_1ISimRunner.xhtml#a659d260f4146f46ffe51bc17f93179ac).





<a id="a6b54a3a3676bc74deea17f50910c3e5b" name="a6b54a3a3676bc74deea17f50910c3e5b"></a>## [◆ ](#a6b54a3a3676bc74deea17f50910c3e5b)Terminate()

 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) simulation\_framework::core::SimRunner::Terminate  ( )   overridevirtual 

Terminates the simulation.

ReturnsA `<a class="el" href="structsimulation__framework_1_1core_1_1StateFeedback.xhtml" title="Represents feedback for the execution status of a control command.">StateFeedback</a>` object containing the status of the termination operation. Implements [simulation\_framework::core::ISimRunner](classsimulation__framework_1_1core_1_1ISimRunner.xhtml#aa5b44639fefef47817aafb6f99719802).





---

The documentation for this class was generated from the following file:- [sim\_runner.h](sim__runner_8h_source.xhtml)