Skip to main content

AVxcelerate Simulation Framework 2026 R1 SP01

Class simulation_framework::autonomy::ActivityFactory

Last update: 22.04.2026

Definition: autonomy/simulation/activity_factory/activity_factory.h (line 39)

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.

See also: core::lifecycle::IActivityFactory, core::lifecycle::IActivity, core::SimulationParameters

Inherits from:

Members

Public functions

Function ActivityFactory

simulation_framework::autonomy::ActivityFactory::ActivityFactory(const core::SimulationParameters &sim_params, const time::milliseconds &base_cycle_time=time::milliseconds{50})

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

Parameters:

Return type:

Function Create

std::unique_ptr< core::lifecycle::IActivity > simulation_framework::autonomy::ActivityFactory::Create(const std::string &activity_name, const core::scheduling::SchedulerClientType type=core::scheduling::SchedulerClientType::kDUMMY) override

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::IActivity instance.

Exceptions:

  • std::runtime_error: if the activity creation fails.

Parameters:

  • const std::string & activity_name
  • const core::scheduling::SchedulerClientType type = core::scheduling::SchedulerClientType::kDUMMY

Return type: std::unique_ptr< core::lifecycle::IActivity >

Reimplements: Create

Function CreateFmuActivity

std::unique_ptr< IActivity > simulation_framework::autonomy::ActivityFactory::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.

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 IActivity instance.

Exceptions:

  • std::runtime_error: if the FMU activity creation fails.

Parameters:

Return type: std::unique_ptr< IActivity >

Reimplements: CreateFmuActivity

Function GetSimulationBaseCycleTime

time::milliseconds simulation_framework::autonomy::ActivityFactory::GetSimulationBaseCycleTime() const override

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.

Return type: time::milliseconds

Reimplements: GetSimulationBaseCycleTime

Function SetSimulationBaseCycleTime

void simulation_framework::autonomy::ActivityFactory::SetSimulationBaseCycleTime(const time::milliseconds &time) override

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.

Parameters:

  • const time::milliseconds & time

Return type: void

Reimplements: SetSimulationBaseCycleTime

Connect with Ansys