Skip to content

Class IGymConnector

Class IGymConnector

  • Defined in File IGymConnector.h
class IGymConnector

Source: 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

SymbolDetails
CollectEnvironmentsCollect all available environments in the current world.
ResolveEnvironmentStateUpdateResolve and retrieve the next environment state update.
ResetEnvironmentsReset specified environments to their initial states.
UpdateEnvironmentsUpdate environments based on the provided state update.
EnableEnable the connector to start processing.
CheckForStartCheck if the connector is ready to start training.
SubmitPostResetStateSubmit 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.

#DirectionNameTypeDescription
1InEnvironmentIdsconst TArray< int > &Array of environment IDs to reset.
2OutStateFTrainingState &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.

#DirectionNameTypeDescription
1StateUpdateconst FTrainingStateUpdate &The update containing actions or reset commands.
2OutStateFTrainingState &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.

#DirectionNameTypeDescription
1Statesconst FTrainingState &The training state containing post-reset observations.
2InEnvironmentIdsconst TArray< int > &Array of environment IDs that were reset.

Attributes: inline, virtual

Source: Source/Schola/Training/Public/GymConnectors/IGymConnector.h