Class simulation_framework::core::SimRunner
Last update: 22.04.2026
Definition: core/service/sim_runner/sim_runner.h (line 27)
Simulation runner with external control logic.
The SimRunner class implements the ISimRunner 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, lifecycle::ISimulationInstance
Inherits from:
Members
- GetExecutedStepCount
- GetSimulationState
- Pause
- Resume
- Run
- RunOverSimulation
- SimRunner
- StepN
- Stop
- Terminate
- ~ISimRunner
- ~SimRunner
Public functions
Function ~SimRunner
simulation_framework::core::SimRunner::~SimRunner()
Destructor for SimRunner.
Return type:
Function SimRunner
simulation_framework::core::SimRunner::SimRunner(std::unique_ptr< lifecycle::ISimulationInstance > sim_instance)
Constructs a SimRunner with a simulation instance.
Parameters:
- sim_instance: A unique pointer to the simulation instance to control.
Parameters:
- std::unique_ptr< lifecycle::ISimulationInstance > sim_instance
Return type:
Function Run
StateFeedback simulation_framework::core::SimRunner::Run() override
Executes the simulation and changes the state to kRunning.
The simulation runs until the scenario ends unless paused or stopped by the user.
Returns:
A StateFeedback object containing execution status and error information, if any.
Return type: StateFeedback
Reimplements: Run
Function Pause
StateFeedback simulation_framework::core::SimRunner::Pause() override
Pauses the simulation.
If the simulation is in the kRunning state, it transitions to the kPaused state.
Returns:
A StateFeedback object containing the status of the pause operation.
Return type: StateFeedback
Reimplements: Pause
Function Resume
StateFeedback simulation_framework::core::SimRunner::Resume() override
Resumes the simulation.
The simulation state changes from kPaused back to kRunning.
Returns:
A StateFeedback object containing the status of the resume operation.
Return type: StateFeedback
Reimplements: Resume
Function StepN
StateFeedback simulation_framework::core::SimRunner::StepN(int n) override
Steps the simulation forward by a specified number of frames.
Parameters:
- n: The number of simulation steps to execute.
Returns:
A StateFeedback object containing the status of the step operation.
Parameters:
- int n
Return type: StateFeedback
Reimplements: StepN
Function Stop
StateFeedback simulation_framework::core::SimRunner::Stop() override
Stops the simulation immediately.
The simulation state resets to kInitialized.
Returns:
A StateFeedback object containing the status of the stop operation.
Return type: StateFeedback
Reimplements: Stop
Function Terminate
StateFeedback simulation_framework::core::SimRunner::Terminate() override
Terminates the simulation.
Returns:
A StateFeedback object containing the status of the termination operation.
Return type: StateFeedback
Reimplements: Terminate
Function GetSimulationState
SimState simulation_framework::core::SimRunner::GetSimulationState() const override
Retrieves the current state of the simulation.
Returns:
The current simulation state as a SimState enum value.
Return type: SimState
Reimplements: GetSimulationState
Function GetExecutedStepCount
uint64_t simulation_framework::core::SimRunner::GetExecutedStepCount() const override
Retrieves the number of executed simulation steps.
The step counter resets if the simulation is restarted.
Returns:
The number of executed simulation steps.
Return type: uint64_t
Reimplements: GetExecutedStepCount
Function RunOverSimulation
void simulation_framework::core::SimRunner::RunOverSimulation() override
Runs the simulation until it ends without accepting further commands.
Return type: void
Reimplements: RunOverSimulation