Skip to content

UExternalGymConnector

class UExternalGymConnector : public UAbstractGymConnector

An abstract class for connectors that communicate with gym using futures.

Dependencies: FTrainingState, FTrainingStateUpdate, UAbstractGymConnector

Inherits from: public UAbstractGymConnector

Subclassed by: UPythonGymConnector

Public Interface

Constructor:

UExternalGymConnector

UExternalGymConnector()

Source: Schola/Source/Schola/Public/GymConnectors/ExternalGymConnector.h (line 27, column 1)

Implementation: Schola/Source/Schola/Private/GymConnectors/ExternalGymConnector.cpp (lines 5-7)

Public Functions:

RequestStateUpdate

inline virtual TFuture<FTrainingStateUpdate *> RequestStateUpdate()

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

Returns: A future that will eventually contain decision for all agents in all environments

Note: This function is asynchronous and will return immediately

Note: This function should be implemented by any derived classes

Returns: TFuture&lt;FTrainingStateUpdate &#42;&gt;

Attributes: inline, virtual

Source: Schola/Source/Schola/Public/GymConnectors/ExternalGymConnector.h (line 35, column 17)

SendState

inline virtual void SendState(const FTrainingState &Value)

Send the state of the environment to gym.

Note: This function should be implemented by any derived classes

Parameters:

  • Value (const FTrainingState &) – [in] The state of the environment

Attributes: inline, virtual

Source: Schola/Source/Schola/Public/GymConnectors/ExternalGymConnector.h (line 43, column 14)

SubmitEnvironmentStates

virtual void SubmitEnvironmentStates() override

Submit environment states to the other end of the connector.

Note: This function should be implemented by a derived class.

Attributes: virtual

Source: Schola/Source/Schola/Public/GymConnectors/ExternalGymConnector.h (line 45, column 6)

Implementation: Schola/Source/Schola/Private/GymConnectors/ExternalGymConnector.cpp (lines 10-13)

ResolveEnvironmentStateUpdate

virtual FTrainingStateUpdate * ResolveEnvironmentStateUpdate() override

Resolve the environment state update.

Useful for connections that operate off of futures, or otherwise require synchronization.

Returns: The resolved environment state update.

Note: This function should be implemented by a derived class.

Returns: FTrainingStateUpdate &#42;

Attributes: virtual

Source: Schola/Source/Schola/Public/GymConnectors/ExternalGymConnector.h (line 47, column 22)

Implementation: Schola/Source/Schola/Private/GymConnectors/ExternalGymConnector.cpp (lines 15-29)

Public Members:

int Timeout

int Timeout = = 30

How long should we wait before assuming decision request has failed.

Source: Schola/Source/Schola/Public/GymConnectors/ExternalGymConnector.h (line 20, column 5)

bool bUseTimeout

bool bUseTimeout = = true

Should we use a timeout for decision requests.

Source: Schola/Source/Schola/Public/GymConnectors/ExternalGymConnector.h (line 24, column 6)

Used By: UPythonGymConnector

Source: Schola/Source/Schola/Public/GymConnectors/ExternalGymConnector.h (line 12, column 1)