> ## 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-r1/classsimulation__framework_1_1autonomy_1_1ActivityFactory__inherit__graph.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=6a144a5658a693281292b9d0d1f93859)

\[[legend](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/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-r1/classsimulation__framework_1_1autonomy_1_1ActivityFactory__coll__graph.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=bf353f76d3e1acd26427dfa0df415e3a)

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

## Public Member Functions

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

Constructs an [`ActivityFactory`](https://developer.synopsys.com/docs/avxcelerate/avxcelerate-simulation-framework/2025-r1/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-r1/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-r1/classsimulation__framework_1_1core_1_1lifecycle_1_1IActivityFactory.md#a2f503485e1f01c9b4c37d79faf440c18).

### 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-r1/classsimulation__framework_1_1core_1_1lifecycle_1_1IActivityFactory.md#a2d0244f1297535e86928b8f65c568304).

### 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-r1/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-r1/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-r1/activity__factory_8h_source.md)
