Class AAbstractScholaEnvironment
- class AAbstractScholaEnvironment : public AActor
-
An abstract class representing an environment.
Subclassed by ABlueprintScholaEnvironment
Public Functions
- void RegisterAgent(AAbstractTrainer *Agent)
-
Register an individual agent with the environment.
Called after the environment is initialized.
- Parameters:
-
Agent – The agent to register
- inline virtual void RegisterAgents(TArray<APawn*> &OutAgentControlledPawnArray)
-
Register a list of agents with the environment, from a list of pawns with associated agents.
Called after the environment is initialized.
- Parameters:
-
OutAgentControlledPawnArray – An array of pawns in the environment that are controlled by agents
- void Initialize()
-
Collects all the AgentObjects from their pawns and then initializes them.
Note
Must be called after play begins. Calls InitializeEnvironment and RegisterAgents.
- void RetrieveUtilityComponents()
-
Retrieve all the utility components from the environment.
Called after the environment is initialized.
- void PopulateAgentStatePointers(FSharedEnvironmentState &OutAgentStatePointers)
-
Used on initialization to populate the AgentStateMapping with the AgentStates pointers.
- Parameters:
-
OutAgentStatePointers – [out] A shared state structure that will be populated with the agent state pointers.
- void PopulateAgentDefinitionPointers(FSharedEnvironmentDefinition &OutEnvDefn)
-
Used on initialization to populate the AgentDefinitionMapping with the AgentDefinition pointers.
- Parameters:
-
OutEnvDefn – [out] A shared environment definition structure that will be populated with the agent definition pointers.
- int GetNumAgents()
-
Get the number of agents registered to this environment.
- Returns:
-
The Number of Agents registered to this environment
- FVector GetEnvironmentCenterPoint()
-
Convenience function to get the centerpoint of the environment for resetting agents.
- Returns:
-
an FVector representation of the center of this environment
- 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
- inline virtual void InitializeEnvironment()
-
Perform any environment setup like initializing variables, or binding delegates.
Occurs before Register Agents.
- void AllAgentsThink()
-
Perform a think step for all agents in the environment.
Collects observations and sends them to the agents.
- void AllAgentsAct(const FEnvStep &EnvUpdate)
-
Perform an act step for all agents in the environment.
Acts on any decisions from the brains
- Parameters:
-
EnvUpdate – [in] The environment update to act on
- void SetEnvId(int EnvironmentId)
-
Set the Id of this environment.
Called when Registering with the subsystem.
- Parameters:
-
EnvironmentId – [in] The Id of the environment
- void UpdateStatus(EEnvironmentStatus NewStatus)
-
Set the status of this environment to the given status.
- Parameters:
-
NewStatus – [in] The new status of the environment
- EEnvironmentStatus GetStatus()
-
Get the current status of this environment.
- Returns:
-
The status of the environment
- 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 – [in] A map of options to configure the environment with
Public Members
- TArray<UAbstractEnvironmentUtilityComponent*> UtilityComponents
-
A list of utility components that can be used to add additional behaviour such as logging or data collection.