Class IGymConnector
Class IGymConnector
- Defined in File IGymConnector.h
class IGymConnectorSource: Source/Schola/Training/Public/GymConnectors/IGymConnector.h
Dependencies: FTrainingState, FTrainingStateUpdate
Interface for connectors between Unreal Engine and gym-compatible training systems.
Defines the core functionality required for connecting Unreal environments to external training frameworks like Stable Baselines 3 or Ray RLlib. Implementations handle environment collection, state synchronization, and action distribution.
Public Functions
| Symbol | Details |
|---|---|
CollectEnvironments | Collect all available environments in the current world. |
ResolveEnvironmentStateUpdate | Resolve and retrieve the next environment state update. |
ResetEnvironments | Reset specified environments to their initial states. |
UpdateEnvironments | Update environments based on the provided state update. |
Enable | Enable the connector to start processing. |
CheckForStart | Check if the connector is ready to start training. |
SubmitPostResetState | Submit the state of environments after a reset operation. |
CollectEnvironments
inline virtual void CollectEnvironments()Collect all available environments in the current world.
Scans the level for environment objects and prepares them for training.
Attributes: inline, virtual
Source: Source/Schola/Training/Public/GymConnectors/IGymConnector.h
ResolveEnvironmentStateUpdate
inline virtual FTrainingStateUpdate *ResolveEnvironmentStateUpdate()Resolve and retrieve the next environment state update.
This may block or return immediately depending on the connector implementation.
Returns:
Pointer to the training state update containing actions or reset commands.
Attributes: inline, virtual
Source: Source/Schola/Training/Public/GymConnectors/IGymConnector.h
ResetEnvironments
inline virtual void ResetEnvironments(const TArray<int> &InEnvironmentIds, FTrainingState &OutState)Reset specified environments to their initial states.
Parameters
-
InEnvironmentIds – [in] Array of environment IDs to reset.
-
OutState – [out] The resulting training state after reset.
| # | Direction | Name | Type | Description |
|---|---|---|---|---|
| 1 | — | InEnvironmentIds | const TArray< int > & | Array of environment IDs to reset. |
| 2 | — | OutState | FTrainingState & | The resulting training state after reset. |
Attributes: inline, virtual
Source: Source/Schola/Training/Public/GymConnectors/IGymConnector.h
UpdateEnvironments
inline virtual void UpdateEnvironments(const FTrainingStateUpdate &StateUpdate, FTrainingState &OutState)Update environments based on the provided state update.
Parameters
-
StateUpdate – [in] The update containing actions or reset commands.
-
OutState – [out] The resulting training state after applying the update.
| # | Direction | Name | Type | Description |
|---|---|---|---|---|
| 1 | — | StateUpdate | const FTrainingStateUpdate & | The update containing actions or reset commands. |
| 2 | — | OutState | FTrainingState & | The resulting training state after applying the update. |
Attributes: inline, virtual
Source: Source/Schola/Training/Public/GymConnectors/IGymConnector.h
Enable
inline virtual void Enable()Enable the connector to start processing.
Attributes: inline, virtual
Source: Source/Schola/Training/Public/GymConnectors/IGymConnector.h
CheckForStart
inline virtual bool CheckForStart()Check if the connector is ready to start training.
Returns:
True if the connector can begin operation.
Attributes: inline, virtual
Source: Source/Schola/Training/Public/GymConnectors/IGymConnector.h
SubmitPostResetState
inline virtual void SubmitPostResetState(const FTrainingState &States, const TArray<int> &InEnvironmentIds)Submit the state of environments after a reset operation.
Parameters
-
States – [in] The training state containing post-reset observations.
-
InEnvironmentIds – [in] Array of environment IDs that were reset.
| # | Direction | Name | Type | Description |
|---|---|---|---|---|
| 1 | — | States | const FTrainingState & | The training state containing post-reset observations. |
| 2 | — | InEnvironmentIds | const TArray< int > & | Array of environment IDs that were reset. |
Attributes: inline, virtual
Source: Source/Schola/Training/Public/GymConnectors/IGymConnector.h