    

 ## 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_r1_num1/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_r1_num1/classsimulation__framework_1_1core_1_1SimRunner__coll__graph.png)

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

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

<a id="a86df4168e20485587e74801f5400dda4"></a> [~SimRunner](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a86df4168e20485587e74801f5400dda4) () 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) 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. [More...](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a961cc52e44842a326e1fc638a6e6f404)  
 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) [Run](classsimulation__framework_1_1core_1_1SimRunner.xhtml#aa47196cb107ebc1c200ab5fd43fc22f9) () override Executes the simulation and changes the state to `kRunning`. [More...](classsimulation__framework_1_1core_1_1SimRunner.xhtml#aa47196cb107ebc1c200ab5fd43fc22f9)  
 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) [Pause](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a2008706db821aed76b79bee747a220ac) () override Pauses the simulation. [More...](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a2008706db821aed76b79bee747a220ac)  
 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) [Resume](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a0bc52ce914b51ce4fc709b0686d05475) () override Resumes the simulation. [More...](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a0bc52ce914b51ce4fc709b0686d05475)  
 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) [StepN](classsimulation__framework_1_1core_1_1SimRunner.xhtml#aa2aecf086a4535c9a4d05b977deb29f3) (int n) override Steps the simulation forward by a specified number of frames. [More...](classsimulation__framework_1_1core_1_1SimRunner.xhtml#aa2aecf086a4535c9a4d05b977deb29f3)  
 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) [Stop](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a122aef144fa4620085078b7ef1d58645) () override Stops the simulation immediately. [More...](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a122aef144fa4620085078b7ef1d58645)  
 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) [Terminate](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a6b54a3a3676bc74deea17f50910c3e5b) () override Terminates the simulation. [More...](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a6b54a3a3676bc74deea17f50910c3e5b)  
 SimState [GetSimulationState](classsimulation__framework_1_1core_1_1SimRunner.xhtml#ab5f6d34b0bbd35000cfff95bcfeb901f) () const Retrieves the current state of the simulation. [More...](classsimulation__framework_1_1core_1_1SimRunner.xhtml#ab5f6d34b0bbd35000cfff95bcfeb901f)  
 uint64\_t [GetExecutedStepCount](classsimulation__framework_1_1core_1_1SimRunner.xhtml#ab7b56bf2aa50f1ca9b14b928268939eb) () const Retrieves the number of executed simulation steps. [More...](classsimulation__framework_1_1core_1_1SimRunner.xhtml#ab7b56bf2aa50f1ca9b14b928268939eb)  
 <a id="a4ba901d04097297295b7b680ac151da9"></a>void [RunOverSimulation](classsimulation__framework_1_1core_1_1SimRunner.xhtml#a4ba901d04097297295b7b680ac151da9) () override Runs the simulation until it ends without accepting further commands.   
 ![-](/sites/default/files/migrate-content/avxcelerate_simulation_framework_2025_r1_num1/closed.png) Public Member Functions inherited from [simulation\_framework::core::ISimRunner](classsimulation__framework_1_1core_1_1ISimRunner.xhtml)<a id="a28739232c9e3879e863cd5fa158ef709"></a>virtual [~ISimRunner](classsimulation__framework_1_1core_1_1ISimRunner.xhtml#a28739232c9e3879e863cd5fa158ef709) ()=default 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")

## Constructor &amp; Destructor Documentation

<a id="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"></a>## [◆ ](#ab7b56bf2aa50f1ca9b14b928268939eb)GetExecutedStepCount()

 uint64\_t 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"></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"></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"></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"></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="aa2aecf086a4535c9a4d05b977deb29f3"></a>## [◆ ](#aa2aecf086a4535c9a4d05b977deb29f3)StepN()

 [StateFeedback](structsimulation__framework_1_1core_1_1StateFeedback.xhtml) simulation\_framework::core::SimRunner::StepN  ( int  *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"></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"></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)