> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# simulation_framework::autonomy::ActivityFactory Class Reference

Factory class for creating activities for autonomy simulation.

`#include <activity_factory.h>`

Inheritance diagram for simulation\_framework::autonomy::ActivityFactory:

![Inheritance graph](https://mintcdn.com/synopsys-00a47cbc/Srh1_f--TdKCLyqD/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1autonomy_1_1ActivityFactory__inherit__graph.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=9c77a5895d35dffd6c542dac92fb0056)

\[[legend](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/graph_legend)]

Collaboration diagram for simulation\_framework::autonomy::ActivityFactory:

![Collaboration graph](https://mintcdn.com/synopsys-00a47cbc/Srh1_f--TdKCLyqD/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1autonomy_1_1ActivityFactory__coll__graph.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=558e8a0b81e5a83b7277403749b31479)

\[[legend](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/graph_legend)]

## Public Member Functions

| Type | Name |
| - | - |
| | [ActivityFactory](#a95a2f9ae094f44fbbfec5391e5fbd97c) ([const](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) [core::SimulationParameters](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/structsimulation__framework_1_1core_1_1SimulationParameters.md) &[sim\_params](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md), [const](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) time::milliseconds &[base\_cycle\_time](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md)=time::milliseconds\{50}) Constructs an [`ActivityFactory`](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1autonomy_1_1ActivityFactory) instance. |
| std::unique\_ptr\< [core::lifecycle::IActivity](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1lifecycle_1_1IActivity.md) > | [Create](#aadc073761ddca70660c778b109cd8f2a) ([const](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) std::string &[activity\_name](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md), [const](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) core::scheduling::SchedulerClientType type=core::scheduling::SchedulerClientType::kDUMMY) [override](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) Creates a simulation activity. |
| std::unique\_ptr\< [IActivity](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1lifecycle_1_1IActivity.md) > | [CreateFmuActivity](#ae25fb9a822daf739975964cdafb610d2) ([const](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) std::string &[activity\_name](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md), [const](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) [core::lifecycle::FmuConfig](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/structsimulation__framework_1_1core_1_1lifecycle_1_1FmuConfig.md) &[fmu\_config](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md), [const](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) scheduling::SchedulerClientType type=scheduling::SchedulerClientType::kDUMMY) [override](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) Creates an FMU-based simulation activity. |
| time::milliseconds | [GetSimulationBaseCycleTime](#a94f462204396f9cb530415976df06210) () [const](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) [override](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) Retrieves the simulation's base cycle time. |
| [void](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) | [SetSimulationBaseCycleTime](#affd15ea8f52128efdef54859ed514dc7) ([const](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) time::milliseconds \&time) [override](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) Sets the simulation's base cycle time. |

> [accordion] Public Member Functions inherited from simulation\_framework::core::lifecycle::IActivityFactory
>
> Public Member Functions inherited from [simulation\_framework::core::lifecycle::IActivityFactory](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1lifecycle_1_1IActivityFactory.md)
>
> | Type | Name |
> | - | - |
> | [virtual](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) | **\~IActivityFactory** ()=[default](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1Topic.md) Virtual destructor for proper cleanup of derived classes. |

## Detailed Description

Factory class for creating activities for autonomy simulation.

The [`ActivityFactory`](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1autonomy_1_1ActivityFactory) 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](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1lifecycle_1_1IActivityFactory.md), [core::lifecycle::IActivity](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1lifecycle_1_1IActivity.md), [core::SimulationParameters](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/structsimulation__framework_1_1core_1_1SimulationParameters.md)

Definition at line [38](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/activity__factory_8h_source.md) of file [activity\_factory.h](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/activity__factory_8h_source.md).

## Constructor & Destructor Documentation

### ActivityFactory()

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

`explicit`

Constructs an [`ActivityFactory`](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1autonomy_1_1ActivityFactory) instance.

Initializes the factory with the simulation parameters and an optional base cycle time.

**Parameters**

| Name | Description |
| - | - |
| 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()

```cpp theme={null}
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` `virtual`

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**

| Name | Description |
| - | - |
| 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`](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1lifecycle_1_1IActivity) instance.

**Exceptions**

| Name | Description |
| - | - |
| std::runtime\_error | if the activity creation fails. |

Implements [simulation\_framework::core::lifecycle::IActivityFactory](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1lifecycle_1_1IActivityFactory.md#a9ec94cdb7f7a92ff15ccee4e63dd0c3c).

### CreateFmuActivity()

```cpp theme={null}
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` `virtual`

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**

| Name | Description |
| - | - |
| 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**

| Name | Description |
| - | - |
| std::runtime\_error | if the FMU activity creation fails. |

Implements [simulation\_framework::core::lifecycle::IActivityFactory](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1lifecycle_1_1IActivityFactory.md#a96c9a911627cd3dd1410e161eca05e63).

### GetSimulationBaseCycleTime()

```cpp theme={null}
time::milliseconds simulation_framework::autonomy::ActivityFactory::GetSimulationBaseCycleTime(
) const
```

`override` `virtual`

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](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1lifecycle_1_1IActivityFactory.md#a4ccd952c296850abe2efccad25634c4d).

### SetSimulationBaseCycleTime()

```cpp theme={null}
void simulation_framework::autonomy::ActivityFactory::SetSimulationBaseCycleTime(
    const time::milliseconds & time
)
```

`override` `virtual`

Sets the simulation's base cycle time.

Updates the base cycle time used for scheduling and synchronization in the simulation.

**Parameters**

| Name | Description |
| - | - |
| time | The new base cycle time in milliseconds. |

Implements [simulation\_framework::core::lifecycle::IActivityFactory](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/classsimulation__framework_1_1core_1_1lifecycle_1_1IActivityFactory.md#ae79c188b8b5e40fc4bfb4e87f24a4a9d).

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

* [activity\_factory.h](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r2-sp02/activity__factory_8h_source.md)
