AAbstractScholaEnvironment
class AAbstractScholaEnvironment : public AActor
An abstract class representing an environment.
Dependencies
This type depends on:
- AAbstractTrainer
- FEnvStep
- FEnvironmentDefinition
- FSharedEnvironmentState
- FTrainerAgentPair
- UAbstractEnvironmentUtilityComponent
Inherits from: public AActor
Subclassed by: ADynamicScholaEnvironment, AStaticScholaEnvironment
Public Interface
Public Functions:
InternalRegisterAgents
inline virtual void InternalRegisterAgents(TArray<FTrainerAgentPair> &OutAgentTrainerPairs)
Register a list of agents with the environment, from a list of pawns with associated agents.
Called after the environment is initialized.
Parameters:
OutAgentTrainerPairs
(TArray<FTrainerAgentPair> &
) – [out] An array of Trainers and their controlled Pawns, representing all agents in the environment.
Attributes: inline
, virtual
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 90, column 14)
Initialize
void Initialize()
Collects all the AgentObjects from their pawns and then initializes them.
Note: Must be called after play begins. Calls InitializeEnvironment and RegisterAgents.
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 101, column 6)
Implementation: Schola/Source/Schola/Private/Environment/AbstractEnvironment.cpp
(lines 5-40)
RetrieveUtilityComponents
void RetrieveUtilityComponents()
Retrieve all the utility components from the environment.
Called after the environment is initialized.
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 106, column 6)
Implementation: Schola/Source/Schola/Private/Environment/AbstractEnvironment.cpp
(lines 42-45)
PopulateAgentStatePointers
void PopulateAgentStatePointers(FSharedEnvironmentState &OutAgentStatePointers)
Used on initialization to populate the AgentStateMapping with the AgentStates pointers.
Parameters:
OutAgentStatePointers
(FSharedEnvironmentState &
) – [out] A shared state structure that will be populated with the agent state pointers.
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 112, column 6)
Implementation: Schola/Source/Schola/Private/Environment/AbstractEnvironment.cpp
(lines 47-53)
PopulateAgentDefinitionPointers
void PopulateAgentDefinitionPointers(FEnvironmentDefinition &OutEnvDefn)
Used on initialization to populate the AgentDefinitionMapping with the AgentDefinition pointers.
Parameters:
OutEnvDefn
(FEnvironmentDefinition &
) – [out] A shared environment definition structure that will be populated with the agent definition pointers.
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 118, column 6)
Implementation: Schola/Source/Schola/Private/Environment/AbstractEnvironment.cpp
(lines 55-62)
GetNumAgents
int GetNumAgents()
Get the number of agents registered to this environment.
Returns: The Number of Agents registered to this environment
Returns: int
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 124, column 5)
Implementation: Schola/Source/Schola/Private/Environment/AbstractEnvironment.cpp
(lines 64-67)
GetEnvironmentCenterPoint
FVector GetEnvironmentCenterPoint()
Convenience function to get the centerpoint of the environment for resetting agents.
Returns: an FVector representation of the center of this environment
Returns: FVector
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 131, column 9)
Implementation: Schola/Source/Schola/Private/Environment/AbstractEnvironment.cpp
(lines 69-72)
ResetEnvironment
inline virtual void ResetEnvironment()
Reset the environment.
Note that this does not reset the agent state.
Note: Subclasses should implement this method to add logic that runs when the environment is reset
Attributes: inline
, virtual
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 137, column 14)
InitializeEnvironment
inline virtual void InitializeEnvironment()
Perform any environment setup like initializing variables, or binding delegates.
Occurs before Register Agents.
Attributes: inline
, virtual
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 142, column 14)
Reset
void Reset()
Reset the environment and any agents in it.
Note: Does not set the state to running.
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 147, column 6)
Implementation: Schola/Source/Schola/Private/Environment/AbstractEnvironment.cpp
(lines 74-108)
MarkCompleted
void MarkCompleted()
Set the EnvironmentState to Resetting.
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 152, column 6)
Implementation: Schola/Source/Schola/Private/Environment/AbstractEnvironment.cpp
(lines 110-113)
AllAgentsThink
void AllAgentsThink()
Perform a think step for all agents in the environment.
Collects observations and sends them to the agents.
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 157, column 6)
Implementation: Schola/Source/Schola/Private/Environment/AbstractEnvironment.cpp
(lines 115-141)
AllAgentsAct
void AllAgentsAct(const FEnvStep &EnvUpdate)
Perform an act step for all agents in the environment.
Acts on any decisions from the brains
Parameters:
EnvUpdate
(const FEnvStep &
) – [in] The environment update to act on
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 163, column 6)
Implementation: Schola/Source/Schola/Private/Environment/AbstractEnvironment.cpp
(lines 143-154)
SetEnvId
void SetEnvId(int EnvironmentId)
Set the Id of this environment.
Called when Registering with the subsystem.
Parameters:
EnvironmentId
(int
) – [in] The Id of the environment
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 169, column 6)
Implementation: Schola/Source/Schola/Private/Environment/AbstractEnvironment.cpp
(lines 156-159)
UpdateStatus
void UpdateStatus(EEnvironmentStatus NewStatus)
Set the status of this environment to the given status.
Parameters:
NewStatus
(EEnvironmentStatus
) – [in] The new status of the environment
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 176, column 6)
Implementation: Schola/Source/Schola/Private/Environment/AbstractEnvironment.cpp
(lines 161-164)
GetStatus
EEnvironmentStatus GetStatus()
Get the current status of this environment.
Returns: The status of the environment
Returns: EEnvironmentStatus
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 182, column 20)
Implementation: Schola/Source/Schola/Private/Environment/AbstractEnvironment.cpp
(lines 166-169)
SetEnvironmentOptions
inline virtual void SetEnvironmentOptions(const TMap<FString, FString> &Options)
Configure this environment based on arbitrary Options from the GymConnector.
Called immediately before the environment is reset, if the gym connector has Options.
Parameters:
Options
(const TMap<FString, FString> &
) – [in] A map of options to configure the environment with
Attributes: inline
, virtual
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 188, column 14)
SeedEnvironment
inline virtual void SeedEnvironment(int Seed)
Configure this environment based on a Seed .
Called immediately before the environment is reset, if the gym connector has a new seed supplied.
Parameters:
Seed
(int
) – [in] The seed to configure the environment with
Attributes: inline
, virtual
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 194, column 14)
Public Members:
FSharedEnvironmentState * State
FSharedEnvironmentState * State
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 84, column 25)
TArray<UAbstractEnvironmentUtilityComponent *> UtilityComponents
TArray<UAbstractEnvironmentUtilityComponent *> UtilityComponents
A list of utility components that can be used to add additional behaviour such as logging or data collection.
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 95, column 8)
Protected Interface
Protected Members:
TMap<int, AAbstractTrainer *> Trainers
TMap<int, AAbstractTrainer *> Trainers = = TMap<int, AAbstractTrainer*>()
A map from the agent ID to the Agent Object.
Attributes: protected
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 68, column 6)
int MaxId
int MaxId = = 0
The current largest Id.
Used for Registering New Agents at runtime.
Attributes: protected
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 72, column 5)
int EnvId
int EnvId
The Id of the environment.
Set at runtime.
Attributes: protected
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 76, column 5)
EEnvironmentStatus EnvironmentStatus
EEnvironmentStatus EnvironmentStatus = = EEnvironmentStatus::Running
The status of the environment.
Attributes: protected
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 80, column 20)
Used By
This type is used by:
- ABlueprintScholaEnvironment
- ADynamicScholaEnvironment
- AStaticScholaEnvironment
- UAbstractGymConnector
Source: Schola/Source/Schola/Public/Environment/AbstractEnvironment.h
(line 61, column 1)