Navigation
API > API/Plugins > API/Plugins/LearningAgentsTraining
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- ULearningAgentsManagerListener
- ULearningAgentsTrainingEnvironment
References
| Module | LearningAgentsTraining |
| Header | /Engine/Plugins/Experimental/LearningAgents/Source/LearningAgentsTraining/Public/LearningAgentsTrainingEnvironment.h |
| Include | #include "LearningAgentsTrainingEnvironment.h" |
Syntax
UCLASS (Abstract, HideDropDown, BlueprintType, Blueprintable)
class ULearningAgentsTrainingEnvironment : public ULearningAgentsManagerListener
Constructors
| Type | Name | Description | |
|---|---|---|---|
| -- Setup -- | |||
ULearningAgentsTrainingEnvironment
(
FVTableHelper& Helper |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | GatherAgentCompletion
(
ELearningAgentsCompletion& OutCompletion, |
-- Completions -- | |
| void | GatherAgentCompletions
(
TArray< ELearningAgentsCompletion >& OutCompletions, |
This callback can be overridden by the Trainer and gathers all the completions for the given set of agents. | |
| void | GatherAgentReward
(
float& OutReward, |
-- Rewards -- | |
| 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. | |
| void | Call this function when it is time to evaluate the completions for your agents. | ||
| void | -- Training Process -- | ||
| UE::Learning::ECompletionMode | GetAgentCompletion
(
const int32 AgentId |
Gets the agent completion mode for the given agent id. | |
| const TLearningArrayView< 1, const UE::Learning::ECompletionMode > | Gets the agent completions as a const array view. | ||
| const TLearningArrayView< 1, const UE::Learning::ECompletionMode > | Gets the all completions as a const array view. | ||
| ELearningAgentsCompletion | GetCompletion
(
const int32 AgentId |
Gets the current completion for an agent. Should be called only after GatherCompletions. | |
| uint64 | GetCompletionIteration
(
const int32 AgentId |
Gets the completion iteration value for the given agent id. | |
| TLearningArrayView< 1, UE::Learning::ECompletionMode > | Gets the episode completions as a mutable array view. | ||
| float | GetEpisodeTime
(
const int32 AgentId |
Gets the current elapsed episode time for the given agent. | |
| UE::Learning::FResetInstanceBuffer & | |||
| float | Gets the current reward for an agent. Should be called only after GatherRewards. | ||
| const TLearningArrayView< 1, const float > | -- Non-blueprint public interface -- | ||
| uint64 | GetRewardIteration
(
const int32 AgentId |
Gets the reward iteration value for the given agent id. | |
| bool | HasCompletion
(
const int32 AgentId |
Returns true if GatherCompletions has been called and the completion already set for the given agent. | |
| bool | Returns true if GatherRewards has been called and the reward already set for the given agent. | ||
| ULearningAgentsTrainingEnvironment * | MakeTrainingEnvironment
(
ULearningAgentsManager*& InManager, |
Constructs the training environment and runs the setup functions for rewards and completions. | |
| void | OnAgentsAdded_Implementation
(
const TArray< int32 >& AgentIds |
||
| void | OnAgentsManagerTick_Implementation
(
const TArray< int32 >& AgentIds, |
||
| void | OnAgentsRemoved_Implementation
(
const TArray< int32 >& AgentIds |
||
| void | OnAgentsReset_Implementation
(
const TArray< int32 >& AgentIds |
||
| void | ResetAgentEpisode
(
const int32 AgentId |
-- Resets -- | |
| 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. | |
| 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. | |
| void | SetupTrainingEnvironment
(
ULearningAgentsManager*& InManager |
Initializes the training environment and runs the setup functions for rewards and completions. |