Skip to main content

AVxcelerate Simulation Framework 2025 R2 SP02

simulation_framework::core::SimRunner Class Reference

Last update: 19.09.2025

Simulation runner with external control logic. More...

#include <sim_runner.h>

Inheritance diagram for simulation_framework::core::SimRunner:
Collaboration diagram for simulation_framework::core::SimRunner:

Public Member Functions

 ~SimRunner ()
 Destructor for SimRunner.
 
 SimRunner (std::unique_ptr< lifecycle::ISimulationInstance > sim_instance)
 Constructs a SimRunner with a simulation instance.
 
StateFeedback Run () override
 Executes the simulation and changes the state to kRunning.
 
StateFeedback Pause () override
 Pauses the simulation.
 
StateFeedback Resume () override
 Resumes the simulation.
 
StateFeedback StepN (int n) override
 Steps the simulation forward by a specified number of frames.
 
StateFeedback Stop () override
 Stops the simulation immediately.
 
StateFeedback Terminate () override
 Terminates the simulation.
 
SimState GetSimulationState () const
 Retrieves the current state of the simulation.
 
uint64_t GetExecutedStepCount () const
 Retrieves the number of executed simulation steps.
 
void RunOverSimulation () override
 Runs the simulation until it ends without accepting further commands.
 
- Public Member Functions inherited from simulation_framework::core::ISimRunner
virtual ~ISimRunner ()=default
 Virtual destructor for proper cleanup of derived classes.
 

Detailed Description

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

Definition at line 26 of file sim_runner.h.

Constructor & Destructor Documentation

◆ SimRunner()

simulation_framework::core::SimRunner::SimRunner ( std::unique_ptr< lifecycle::ISimulationInstance sim_instance)
explicit

Constructs a SimRunner with a simulation instance.

Parameters
sim_instanceA unique pointer to the simulation instance to control.

Member Function Documentation

◆ 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.

Returns
The number of executed simulation steps.

Implements simulation_framework::core::ISimRunner.

◆ GetSimulationState()

SimState simulation_framework::core::SimRunner::GetSimulationState ( ) const
virtual

Retrieves the current state of the simulation.

Returns
The current simulation state as a SimState enum value.

Implements simulation_framework::core::ISimRunner.

◆ Pause()

StateFeedback simulation_framework::core::SimRunner::Pause ( )
overridevirtual

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.

Implements simulation_framework::core::ISimRunner.

◆ Resume()

StateFeedback simulation_framework::core::SimRunner::Resume ( )
overridevirtual

Resumes the simulation.

The simulation state changes from kPaused back to kRunning.

Returns
A StateFeedback object containing the status of the resume operation.

Implements simulation_framework::core::ISimRunner.

◆ Run()

StateFeedback 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.

Returns
A StateFeedback object containing execution status and error information, if any.

Implements simulation_framework::core::ISimRunner.

◆ RunOverSimulation()

void simulation_framework::core::SimRunner::RunOverSimulation ( )
overridevirtual

Runs the simulation until it ends without accepting further commands.

Implements simulation_framework::core::ISimRunner.

◆ StepN()

StateFeedback 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.
Returns
A StateFeedback object containing the status of the step operation.

Implements simulation_framework::core::ISimRunner.

◆ Stop()

StateFeedback simulation_framework::core::SimRunner::Stop ( )
overridevirtual

Stops the simulation immediately.

The simulation state resets to kInitialized.

Returns
A StateFeedback object containing the status of the stop operation.

Implements simulation_framework::core::ISimRunner.

◆ Terminate()

StateFeedback simulation_framework::core::SimRunner::Terminate ( )
overridevirtual

Terminates the simulation.

Returns
A StateFeedback object containing the status of the termination operation.

Implements simulation_framework::core::ISimRunner.


The documentation for this class was generated from the following file:

Connect with Ansys