Class simulation_framework::core::lifecycle::IActivity
Last update: 09.03.2026
Definition: core/lifecycle/activity/i_activity.h (line 26)
Interface for simulation activities.
The IActivity interface defines the lifecycle of a simulation activity, including initialization, stepping logic, finalization, and shutdown processes. It also provides methods for handling communication, file input/output, and retrieving simulation metadata.
Inherited by:
Members
- Finalize
- GetCurrentTimestamp
- GetCustomizedParameters
- GetCycleTime
- GetName
- GetSimulationOutputDirectory
- Init
- SetSimulationSettings
- SetUpCommunication
- Shutdown
- Step
- WaitForPubSubConnection
- ~IActivity
Public functions
Function ~IActivity
virtual simulation_framework::core::lifecycle::IActivity::~IActivity()=default
Virtual destructor for proper cleanup of derived classes.
Return type:
Function Init
virtual void simulation_framework::core::lifecycle::IActivity::Init()=0
Initializes the activity.
Implement any logic related to the initialization phase here.
Return type: void
Reimplemented by:
Function WaitForPubSubConnection
virtual void simulation_framework::core::lifecycle::IActivity::WaitForPubSubConnection()=0
Waits until Pub/Sub pairing is complete.
Ensures the communication channels are correctly paired before proceeding.
Returns:
true if pairing is successful, otherwise false.
Return type: void
Reimplemented by:
Function Step
virtual void simulation_framework::core::lifecycle::IActivity::Step()=0
Executes one step of the activity.
Implement the main logic for each simulation step here.
Return type: void
Reimplemented by:
Function Finalize
virtual void simulation_framework::core::lifecycle::IActivity::Finalize()=0
Finalizes the activity.
Implement any logic related to the finalization phase here.
Return type: void
Reimplemented by:
Function Shutdown
virtual void simulation_framework::core::lifecycle::IActivity::Shutdown()=0
Shuts down the activity.
Implement logic to conclude the activity and release any resources here.
Return type: void
Reimplemented by:
Function GetName
virtual std::string simulation_framework::core::lifecycle::IActivity::GetName() const =0
Retrieves the name of the activity.
Returns:
The name of the activity as a string.
Return type: std::string
Reimplemented by:
Function GetCurrentTimestamp
virtual time::Timestamp simulation_framework::core::lifecycle::IActivity::GetCurrentTimestamp() const =0
Retrieves the current simulation timestamp.
This provides the simulation's current time as a Timestamp object.
Returns:
The current simulation timestamp.
Return type: time::Timestamp
Reimplemented by:
Function GetCycleTime
virtual std::chrono::milliseconds simulation_framework::core::lifecycle::IActivity::GetCycleTime() const =0
Retrieves the cycle time of the activity.
The cycle time indicates how often the activity executes.
Returns:
The cycle time as a duration in milliseconds.
Return type: std::chrono::milliseconds
Reimplemented by:
Function GetCustomizedParameters
virtual const SimulationParameters::CustomizedParameters & simulation_framework::core::lifecycle::IActivity::GetCustomizedParameters() const =0
Retrieves the customized parameters for the activity.
Returns:
A map of customized parameters.
Return type: const SimulationParameters::CustomizedParameters &
Reimplemented by:
Function GetSimulationOutputDirectory
virtual std::string simulation_framework::core::lifecycle::IActivity::GetSimulationOutputDirectory() const =0
Retrieves the output directory for simulation results.
The directory where all simulation outputs will be stored.
Returns:
The output directory as a string.
Return type: std::string
Reimplemented by:
Function SetUpCommunication
virtual void simulation_framework::core::lifecycle::IActivity::SetUpCommunication()=0
Sets up the Pub/Sub communication for the activity.
Registers the activity's communication channels into the bus.
Return type: void
Reimplemented by:
Function SetSimulationSettings
virtual void simulation_framework::core::lifecycle::IActivity::SetSimulationSettings(const scheduling::SimulationSettings &sim_settings)=0
Set the simulation settings for this activity.
Parameters:
- sim_settings: The simulation settings struct
Parameters:
- const scheduling::SimulationSettings & sim_settings
Return type: void
Reimplemented by: