Skip to content

Class URPCGymConnector

Class URPCGymConnector

  • Defined in File gRPCGymConnector.h

Inheritance Relationships

Base Type

class URPCGymConnector : public UExternalGymConnector

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/gRPCGymConnector.h

Dependencies: FInitialState, FLaunchableScript, FRPCServerSettings, FScriptSettings, FTrainingDefinition, FTrainingState, FTrainingStateUpdate, IConsumerBackend, IExchangeBackend, IProducerBackend, UCommunicationManager

A connection to an external gym API implemented in Python, using gRPC for communication.


Public Functions

SymbolDetails
URPCGymConnectorEnd of Settings.
RequestStateUpdateRequest a state update from the gym API using the current state of the agents from environments.
SubmitStateSubmit the current training state to the external training system.
SubmitStateWithInitialStateSubmit both training state and initial state (for environments that reset).
SubmitInitialStateSubmit only the initial state (for reset-only operations).
InitInitialize the connector with the given training definitions.
CheckForStartCheck if the start request has been received.
GetAutoResetTypeGet the auto-reset behavior for this connector.

URPCGymConnector

URPCGymConnector()

End of Settings.

Create a new UPythonGymConnector.

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/gRPCGymConnector.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/gRPCGymConnector.cpp

RequestStateUpdate

virtual TFuture<FTrainingStateUpdate *> RequestStateUpdate() override

Request a state update from the gym API using the current state of the agents from environments.

Returns:

A future that will eventually contain the decision for all agents in all environments.

Attributes: virtual

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/gRPCGymConnector.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/gRPCGymConnector.cpp

SubmitState

virtual void SubmitState(const FTrainingState &InTrainingState) override

Submit the current training state to the external training system.

Must be implemented by derived classes to handle state submission.

Parameters

InTrainingState – [in] The state containing observations, rewards, and done flags.

#DirectionNameTypeDescription
1InTrainingStateconst FTrainingState &The state containing observations, rewards, and done flags.

Attributes: virtual

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/gRPCGymConnector.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/gRPCGymConnector.cpp

SubmitStateWithInitialState

virtual void
SubmitStateWithInitialState(const FTrainingState &InTrainingState,
const FInitialState &InInitialAgentStates) override

Submit both training state and initial state (for environments that reset).

Must be implemented by derived classes.

Parameters

  • InTrainingState – [in] The current training state.

  • InInitialAgentStates – [in] The initial states for reset environments.

#DirectionNameTypeDescription
1InTrainingStateconst FTrainingState &The current training state.
2InInitialAgentStatesconst FInitialState &The initial states for reset environments.

Attributes: virtual

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/gRPCGymConnector.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/gRPCGymConnector.cpp

SubmitInitialState

virtual void
SubmitInitialState(const FInitialState &InInitialAgentStates) override

Submit only the initial state (for reset-only operations).

Must be implemented by derived classes.

Parameters

InInitialAgentStates – [in] The initial states for reset environments.

#DirectionNameTypeDescription
1InInitialAgentStatesconst FInitialState &The initial states for reset environments.

Attributes: virtual

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/gRPCGymConnector.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/gRPCGymConnector.cpp

Init

virtual void Init(const FTrainingDefinition &AgentDefns) override

Initialize the connector with the given training definitions.

Parameters

AgentDefns – [in] The training definitions to initialize with.

#DirectionNameTypeDescription
1AgentDefnsconst FTrainingDefinition &The training definitions to initialize with.

Attributes: virtual

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/gRPCGymConnector.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/gRPCGymConnector.cpp

CheckForStart

virtual bool CheckForStart() override

Check if the start request has been received.

Returns:

True if the start request has been received, false otherwise.

Attributes: virtual

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/gRPCGymConnector.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/gRPCGymConnector.cpp

GetAutoResetType

virtual EAutoResetType GetAutoResetType() override

Get the auto-reset behavior for this connector.

Controls when environments automatically reset after episode completion.

Returns:

The auto-reset type (default: SameStep).

Attributes: virtual

Source: Source/Schola/Protobuf/Public/GymConnectors/gRPC/gRPCGymConnector.h

Implementation: Source/Schola/Protobuf/Private/GymConnectors/gRPC/gRPCGymConnector.cpp


Public Members

SymbolDetails
bRunScriptOnPlaySettings.
ServerSettings
ScriptSettingsThe settings for the python script to be launched.
Script

bRunScriptOnPlay

bool bRunScriptOnPlay = false

Settings.


ServerSettings

FRPCServerSettings ServerSettings

ScriptSettings

FScriptSettings ScriptSettings

The settings for the python script to be launched.


Script

FLaunchableScript Script