simulation_framework::autonomy::ActivityFactory Class Reference
Last update: 19.09.2025Factory class for creating activities for autonomy simulation. More...
#include <activity_factory.h>


Public Member Functions | |
| ActivityFactory (const core::SimulationParameters &sim_params, const time::milliseconds &base_cycle_time=time::milliseconds{50}) | |
Constructs an ActivityFactory instance. | |
| std::unique_ptr< core::lifecycle::IActivity > | Create (const std::string &activity_name, const core::scheduling::SchedulerClientType type=core::scheduling::SchedulerClientType::kDUMMY) override |
| Creates a simulation activity. | |
| std::unique_ptr< IActivity > | CreateFmuActivity (const std::string &activity_name, const core::lifecycle::FmuConfig &fmu_config, const scheduling::SchedulerClientType type=scheduling::SchedulerClientType::kDUMMY) override |
| Creates an FMU-based simulation activity. | |
| time::milliseconds | GetSimulationBaseCycleTime () const override |
| Retrieves the simulation's base cycle time. | |
| void | SetSimulationBaseCycleTime (const time::milliseconds &time) override |
| Sets the simulation's base cycle time. | |
Public Member Functions inherited from simulation_framework::core::lifecycle::IActivityFactory | |
| virtual | ~IActivityFactory ()=default |
| Virtual destructor for proper cleanup of derived classes. | |
Detailed Description
Factory class for creating activities for autonomy simulation.
The ActivityFactory implements the IActivityFactory interface to provide mechanisms for creating and managing simulation activities. It supports creating both generic and FMU-based activities, allowing for flexible integration into various simulation workflows.
The class also manages the base cycle time for the simulation, which can be retrieved or modified as needed.
Definition at line 38 of file activity_factory.h.
Constructor & Destructor Documentation
◆ ActivityFactory()
|
explicit |
Constructs an ActivityFactory instance.
Initializes the factory with the simulation parameters and an optional base cycle time.
- Parameters
-
sim_params The simulation parameters used to configure activities created by this factory. base_cycle_time The base cycle time for the simulation (default: 50 milliseconds).
Member Function Documentation
◆ Create()
|
overridevirtual |
Creates a simulation activity.
Generates a simulation activity based on the provided name and scheduler client type. The activity is returned as a unique pointer for efficient memory management.
- Parameters
-
activity_name The name of the activity to create. type The type of scheduler client to associate with the activity (default: core::scheduling::SchedulerClientType::kDUMMY).
- Returns
- A unique pointer to the created
core::lifecycle::IActivityinstance.
- Exceptions
-
std::runtime_error if the activity creation fails.
Implements simulation_framework::core::lifecycle::IActivityFactory.
◆ CreateFmuActivity()
|
overridevirtual |
Creates an FMU-based simulation activity.
Generates a simulation activity specific to an FMU (Functional Mock-up Unit), using the provided FMU configuration and scheduler client type.
- Parameters
-
activity_name The name of the FMU activity to create. fmu_config The configuration details for the FMU. type The type of scheduler client to associate with the activity (default: core::scheduling::SchedulerClientType::kDUMMY).
- Returns
- A unique pointer to the created FMU activity as an
IActivityinstance.
- Exceptions
-
std::runtime_error if the FMU activity creation fails.
Implements simulation_framework::core::lifecycle::IActivityFactory.
◆ GetSimulationBaseCycleTime()
|
overridevirtual |
Retrieves the simulation's base cycle time.
Provides the base cycle time used for scheduling and synchronization in the simulation.
- Returns
- The simulation base cycle time in milliseconds.
Implements simulation_framework::core::lifecycle::IActivityFactory.
◆ SetSimulationBaseCycleTime()
|
overridevirtual |
Sets the simulation's base cycle time.
Updates the base cycle time used for scheduling and synchronization in the simulation.
- Parameters
-
time The new base cycle time in milliseconds.
Implements simulation_framework::core::lifecycle::IActivityFactory.
The documentation for this class was generated from the following file:
Public Member Functions inherited from