Navigation
API > API/Plugins > API/Plugins/LearningAgentsTraining
| Name | ULearningAgentsTrainingEnvironment |
| Type | class |
| Header File | /Engine/Plugins/Experimental/LearningAgents/Source/LearningAgentsTraining/Public/LearningAgentsTrainingEnvironment.h |
| Include Path | #include "LearningAgentsTrainingEnvironment.h" |
Syntax
UCLASS (MinimalAPI, Abstract, HideDropDown, BlueprintType, Blueprintable)
class ULearningAgentsTrainingEnvironment : public ULearningAgentsManagerListener
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → ULearningAgentsManagerListener → ULearningAgentsTrainingEnvironment
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| -- Setup -- | LearningAgentsTrainingEnvironment.h | ||
ULearningAgentsTrainingEnvironment
(
FVTableHelper& Helper |
LearningAgentsTrainingEnvironment.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~ULearningAgentsTrainingEnvironment() |
LearningAgentsTrainingEnvironment.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AgentCompletions | TLearningArray< 1, UE::Learning::ECompletionMode > | Agent Completions Buffer | LearningAgentsTrainingEnvironment.h | |
| AllCompletions | TLearningArray< 1, UE::Learning::ECompletionMode > | All Completions Buffer | LearningAgentsTrainingEnvironment.h | |
| CompletionBuffer | TArray< ELearningAgentsCompletion > | Callback Completion Output | LearningAgentsTrainingEnvironment.h | |
| CompletionIteration | TLearningArray< 1, uint64, TInlineAllocator< 32 > > | Number of times completions have been evaluated for all agents | LearningAgentsTrainingEnvironment.h | |
| EpisodeCompletions | TLearningArray< 1, UE::Learning::ECompletionMode > | Episode Completions Buffer | LearningAgentsTrainingEnvironment.h | |
| EpisodeTimes | TLearningArray< 1, float > | Agent episode times | LearningAgentsTrainingEnvironment.h | |
| ResetBuffer | TUniquePtr< UE::Learning::FResetInstanceBuffer > | LearningAgentsTrainingEnvironment.h | ||
| RewardBuffer | TArray< float > | --Private Data -- | LearningAgentsTrainingEnvironment.h | |
| RewardIteration | TLearningArray< 1, uint64, TInlineAllocator< 32 > > | Number of times rewards have been evaluated for all agents | LearningAgentsTrainingEnvironment.h | |
| Rewards | TLearningArray< 1, float > | Reward Buffer | LearningAgentsTrainingEnvironment.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void GatherAgentCompletion
(
ELearningAgentsCompletion& OutCompletion, |
-- Completions -- | LearningAgentsTrainingEnvironment.h |
|
void GatherAgentCompletions
(
TArray< ELearningAgentsCompletion >& OutCompletions, |
This callback can be overridden by the Trainer and gathers all the completions for the given set of agents. | LearningAgentsTrainingEnvironment.h |
|
void GatherAgentReward
(
float& OutReward, |
-- Rewards -- | LearningAgentsTrainingEnvironment.h |
|
void GatherAgentRewards
(
TArray< float >& OutRewards, |
This callback can be overridden by the Trainer and gathers all the reward values for the given set of agents. | LearningAgentsTrainingEnvironment.h |
|
void GatherCompletions () |
Call this function when it is time to evaluate the completions for your agents. | LearningAgentsTrainingEnvironment.h |
|
void GatherRewards () |
-- Training Process -- | LearningAgentsTrainingEnvironment.h |
|
UE::Learning::ECompletionMode GetAgentCompletion
(
const int32 AgentId |
Gets the agent completion mode for the given agent id. | LearningAgentsTrainingEnvironment.h | |
const TLearningArrayView< 1, const UE::Learning::ECompletionMode > GetAgentCompletions() |
Gets the agent completions as a const array view. | LearningAgentsTrainingEnvironment.h | |
const TLearningArrayView< 1, const UE::Learning::ECompletionMode > GetAllCompletions() |
Gets the all completions as a const array view. | LearningAgentsTrainingEnvironment.h | |
ELearningAgentsCompletion GetCompletion
(
const int32 AgentId |
Gets the current completion for an agent. Should be called only after GatherCompletions. | LearningAgentsTrainingEnvironment.h |
|
uint64 GetCompletionIteration
(
const int32 AgentId |
Gets the completion iteration value for the given agent id. | LearningAgentsTrainingEnvironment.h | |
TLearningArrayView< 1, UE::Learning::ECompletionMode > GetEpisodeCompletions() |
Gets the episode completions as a mutable array view. | LearningAgentsTrainingEnvironment.h | |
float GetEpisodeTime
(
const int32 AgentId |
Gets the current elapsed episode time for the given agent. | LearningAgentsTrainingEnvironment.h |
|
UE::Learning::FResetInstanceBuffer & GetResetBuffer() |
LearningAgentsTrainingEnvironment.h | ||
float GetReward
(
const int32 AgentId |
Gets the current reward for an agent. Should be called only after GatherRewards. | LearningAgentsTrainingEnvironment.h |
|
const TLearningArrayView< 1, const float > GetRewardArrayView () |
-- Non-blueprint public interface -- | LearningAgentsTrainingEnvironment.h | |
uint64 GetRewardIteration
(
const int32 AgentId |
Gets the reward iteration value for the given agent id. | LearningAgentsTrainingEnvironment.h | |
bool HasCompletion
(
const int32 AgentId |
Returns true if GatherCompletions has been called and the completion already set for the given agent. | LearningAgentsTrainingEnvironment.h |
|
bool HasReward
(
const int32 AgentId |
Returns true if GatherRewards has been called and the reward already set for the given agent. | LearningAgentsTrainingEnvironment.h |
|
virtual void OnAgentsAdded_Implementation
(
const TArray< int32 >& AgentIds |
LearningAgentsTrainingEnvironment.h | ||
virtual void OnAgentsManagerTick_Implementation
(
const TArray< int32 >& AgentIds, |
LearningAgentsTrainingEnvironment.h | ||
virtual void OnAgentsRemoved_Implementation
(
const TArray< int32 >& AgentIds |
LearningAgentsTrainingEnvironment.h | ||
virtual void OnAgentsReset_Implementation
(
const TArray< int32 >& AgentIds |
LearningAgentsTrainingEnvironment.h | ||
void ResetAgentEpisode
(
const int32 AgentId |
-- Resets -- | LearningAgentsTrainingEnvironment.h |
|
void ResetAgentEpisodes
(
const TArray< int32 >& AgentIds |
This callback can be overridden by the Trainer and resets all episodes for each agent in the given set. | LearningAgentsTrainingEnvironment.h |
|
void SetAllCompletions
(
UE::Learning::FIndexSet AgentSet |
Computes a combined completion buffer for agents that have been completed manually and those which have reached the maximum episode length. | LearningAgentsTrainingEnvironment.h | |
void SetupTrainingEnvironment
(
UPARAM(ref) ULearningAgentsManager*& InManager |
Initializes the training environment and runs the setup functions for rewards and completions. | LearningAgentsTrainingEnvironment.h |
|
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static ULearningAgentsTrainingEnvironment * MakeTrainingEnvironment
(
UPARAM(ref) ULearningAgentsManager*& InManager, |
Constructs the training environment and runs the setup functions for rewards and completions. | LearningAgentsTrainingEnvironment.h |
|