Navigation
API > API/Plugins > API/Plugins/LearningAgentsTraining
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- ULearningAgentsCompletion
- UConditionalCompletion
- UPlanarPositionDifferenceCompletion
- UPlanarPositionSimilarityCompletion
- UTimeElapsedCompletion
References
| Module | LearningAgentsTraining |
| Header | /Engine/Plugins/Experimental/LearningAgents/Source/LearningAgentsTraining/Public/LearningAgentsCompletions.h |
| Include | #include "LearningAgentsCompletions.h" |
Syntax
UCLASS&40;Abstract, BlueprintType&41;
class ULearningAgentsCompletion : public UObject
Remarks
For functions in this file, we are favoring having more verbose names such as "AddConditionalCompletion" vs simply "Add" in order to keep it easy to find the correct function in blueprints. The base class for all completions. Completions contain logic that determines if an agent's current episode should end, e.g. because the agent achieved the normal win/loss condition for the game. Additionally, completions can speed up training by ending episodes early if the agent has gotten into a state where training data is no longer useful, e.g. the agent is stuck somewhere. These two modes of completions are expressed with the following enum values: ELearningAgentsCompletion::Termination - used when the episode ends in an expected way and no further rewards should be expected, i.e. do not use the value function to estimate future rewards. ELearningAgentsCompletion::Truncation - used when the episode ends in an unexpected way, mainly to speed up the training process. The agent should expect additional rewards if training were to continue, so it should use its value function to estimate future rewards.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TLearningArray< 1, uint64, TInlineAllocator< 32 > > | AgentIteration | Number of times this completion has been set for all agents | |
| TObjectPtr< ULearningAgentsTrainer > | AgentTrainer | Reference to the Trainer this completion is associated with. | |
| FLinearColor | VisualLogColor | Color used to draw this completion in the visual log |
Functions
| Type | Name | Description | |
|---|---|---|---|
| uint64 | GetAgentIteration
(
const int32 AgentId |
Get the number of times a completion has been set for the given agent id. | |
| void | Init
(
const int32 MaxAgentNum |
Initialize the internal state for a given maximum number of agents | |
| void | OnAgentsAdded
(
const TArray< int32 >& AgentIds |
Called whenever agents are added to the associated ULearningAgentsTrainer object. | |
| void | OnAgentsRemoved
(
const TArray< int32 >& AgentIds |
Called whenever agents are removed from the associated ULearningAgentsTrainer object. | |
| void | OnAgentsReset
(
const TArray< int32 >& AgentIds |
Called whenever agents are reset on the associated ULearningAgentsTrainer object. | |
| void | VisualLog
(
const UE::Learning::FIndexSet Instances |
Describes this completion to the visual logger for debugging purposes. |