Navigation
API > API/Plugins > API/Plugins/LearningAgentsTraining > API/Plugins/LearningAgentsTraining/ULearningAgentsRewards
Description
Make a reward based on the distance between two locations. Gives a larger reward the further the distance between the locations.
| Name | MakeRewardFromLocationDifference |
| Type | function |
| Header File | /Engine/Plugins/Experimental/LearningAgents/Source/LearningAgentsTraining/Public/LearningAgentsRewards.h |
| Include Path | #include "LearningAgentsRewards.h" |
| Source | /Engine/Plugins/Experimental/LearningAgents/Source/LearningAgentsTraining/Private/LearningAgentsRewards.cpp |
UFUNCTION (BlueprintPure, Category="LearningAgents",
Meta=(AdvancedDisplay=4, DefaultToSelf="VisualLoggerListener"))
static float MakeRewardFromLocationDifference
(
const FVector LocationA,
const FVector LocationB,
const float LocationScale,
const float RewardScale,
const FName Tag,
const bool bVisualLoggerEnabled,
ULearningAgentsManagerListener * VisualLoggerListener,
const int32 VisualLoggerAgentId,
const FVector VisualLoggerLocation,
const FLinearColor VisualLoggerColor
)
The resulting reward value.
Parameters
| Name | Remarks |
|---|---|
| LocationA | The first location. |
| LocationB | The second location. |
| LocationScale | The expected scale for the distance between locations. |
| RewardScale | The scale of the reward. Use a negative scale to create a penalty. |
| Tag | The tag for the reward. Used for debugging. |
| bVisualLoggerEnabled | When true, debug data will be sent to the visual logger. |
| VisualLoggerListener | The listener object which is making this reward. This must be set to use logging. |
| VisualLoggerAgentId | The agent id associated with this reward. |
| VisualLoggerLocation | A location for the visual logger information in the world. |
| VisualLoggerColor | The color for the visual logger display. |