UPythonGymConnector
class UPythonGymConnector : public UExternalGymConnectorA connection to an external gym API implemented in Python, using gRPC for communication.
Note: This can theoretically work with any gRPC client, not just Python, although that is untested currently.
Dependencies
This type depends on:
- FTrainingDefinition
- FTrainingState
- FTrainingStateUpdate
- IExchangeBackendInterface
- IPollingBackendInterface
- IProducerBackendInterface
- UCommunicationManager
- UExternalGymConnector
Inherits from: public UExternalGymConnector
Public Interface
Constructor:
UPythonGymConnector
UPythonGymConnector()Create a new UPythonGymConnector.
Source: Schola/Source/Schola/Public/GymConnectors/PythonGymConnector.h (line 96, column 1)
Implementation: Schola/Source/Schola/Private/GymConnectors/PythonGymConnector.cpp (lines 5-7)
Public Functions:
RequestStateUpdate
virtual TFuture<FTrainingStateUpdate *> RequestStateUpdate() overrideRequest 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.
Note: This function is asynchronous and will return immediately.
Returns: TFuture<FTrainingStateUpdate *>
Attributes: virtual
Source: Schola/Source/Schola/Public/GymConnectors/PythonGymConnector.h (line 103, column 9)
Implementation: Schola/Source/Schola/Private/GymConnectors/PythonGymConnector.cpp (lines 9-12)
SendState
virtual void SendState(const FTrainingState &Value) overrideSend the current state to the gym.
Parameters:
Value(const FTrainingState &) – [in] The current state of the training.
Attributes: virtual
Source: Schola/Source/Schola/Public/GymConnectors/PythonGymConnector.h (line 109, column 6)
Implementation: Schola/Source/Schola/Private/GymConnectors/PythonGymConnector.cpp (lines 14-18)
SubmitPostResetState
virtual void SubmitPostResetState(const FTrainingState &Value) overrideSubmit the post-reset state to the gym.
Parameters:
Value(const FTrainingState &) – [in] The state after a reset.
Attributes: virtual
Source: Schola/Source/Schola/Public/GymConnectors/PythonGymConnector.h (line 115, column 6)
Implementation: Schola/Source/Schola/Private/GymConnectors/PythonGymConnector.cpp (lines 20-36)
Init
virtual void Init(const FTrainingDefinition &AgentDefns) overrideInitialize the connector with the given training definitions.
Parameters:
AgentDefns(const FTrainingDefinition &) – [in] The training definitions to initialize with.
Attributes: virtual
Source: Schola/Source/Schola/Public/GymConnectors/PythonGymConnector.h (line 121, column 6)
Implementation: Schola/Source/Schola/Private/GymConnectors/PythonGymConnector.cpp (lines 38-72)
Enable
virtual void Enable() overrideEnable the connector.
Attributes: virtual
Source: Schola/Source/Schola/Public/GymConnectors/PythonGymConnector.h (line 126, column 6)
Implementation: Schola/Source/Schola/Private/GymConnectors/PythonGymConnector.cpp (lines 74-77)
CheckForStart
virtual bool CheckForStart() overrideCheck if the start request has been received.
Returns: True if the start request has been received, false otherwise.
Returns: bool
Attributes: virtual
Source: Schola/Source/Schola/Public/GymConnectors/PythonGymConnector.h (line 132, column 6)
Implementation: Schola/Source/Schola/Private/GymConnectors/PythonGymConnector.cpp (lines 79-87)
Private Interface
Private Members:
IPollingBackendInterface<GymConnectorStartRequest> * StartRequestService
IPollingBackendInterface<GymConnectorStartRequest> * StartRequestServiceA type for a consumer interface that collects an initial GymConnectorStartRequest.
Attributes: private
Source: Schola/Source/Schola/Public/GymConnectors/PythonGymConnector.h (line 78, column 26)
DRSType DecisionRequestService
DRSType DecisionRequestServiceThe service that will handle decision requests.
Attributes: private
Source: Schola/Source/Schola/Public/GymConnectors/PythonGymConnector.h (line 81, column 9)
ADSType AgentDefinitionService
ADSType AgentDefinitionServiceThe service that will handle publishing agent definitions.
Attributes: private
Source: Schola/Source/Schola/Public/GymConnectors/PythonGymConnector.h (line 83, column 9)
PRSType PostResetStateService
PRSType PostResetStateServiceThe service that will handle publishing the state after each reset.
Attributes: private
Source: Schola/Source/Schola/Public/GymConnectors/PythonGymConnector.h (line 85, column 9)
UCommunicationManager * CommunicationManager
UCommunicationManager * CommunicationManagerThe communication manager that will handle the gRPC server.
Attributes: private
Source: Schola/Source/Schola/Public/GymConnectors/PythonGymConnector.h (line 89, column 23)
Source: Schola/Source/Schola/Public/GymConnectors/PythonGymConnector.h (line 67, column 1)