Navigation
API > API/Plugins > API/Plugins/LearningAgentsTraining
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- ULearningAgentsReward
- UConditionalReward
- UFloatReward
- ULocalDirectionalVelocityReward
- UPlanarPositionDifferencePenalty
- UPositionArraySimilarityReward
- UScalarVelocityReward
References
| Module | LearningAgentsTraining |
| Header | /Engine/Plugins/Experimental/LearningAgents/Source/LearningAgentsTraining/Public/LearningAgentsRewards.h |
| Include | #include "LearningAgentsRewards.h" |
Syntax
UCLASS&40;Abstract, BlueprintType&41;
class ULearningAgentsReward : public UObject
Remarks
For functions in this file, we are favoring having more verbose names such as "AddFloatReward" vs simply "Add" in order to keep it easy to find the correct function in blueprints. Base class for all rewards/penalties. Rewards are used during reinforcement learning to encourage/discourage certain behaviors from occurring.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TLearningArray< 1, uint64, TInlineAllocator< 32 > > | AgentIteration | Number of times this reward has been set for all agents | |
| TObjectPtr< ULearningAgentsTrainer > | AgentTrainer | Reference to the Trainer this reward is associated with. | |
| FLinearColor | VisualLogColor | Color used to draw this reward in the visual log |
Functions
| Type | Name | Description | |
|---|---|---|---|
| uint64 | GetAgentIteration
(
const int32 AgentId |
Get the number of times a reward 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 reward to the visual logger for debugging purposes. |