Navigation
API > API/Plugins > API/Plugins/LearningAgents
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- ULearningAgentsManagerListener
- ULearningAgentsPolicy
References
| Module | LearningAgents |
| Header | /Engine/Plugins/Experimental/LearningAgents/Source/LearningAgents/Public/LearningAgentsPolicy.h |
| Include | #include "LearningAgentsPolicy.h" |
Syntax
UCLASS (BlueprintType, Blueprintable, Meta=(BlueprintSpawnableComponent))
class ULearningAgentsPolicy : public ULearningAgentsManagerListener
Remarks
A policy that maps from observations to actions.
Constructors
| Type | Name | Description | |
|---|---|---|---|
| These constructors/destructors are needed to make forward declarations happy. | |||
ULearningAgentsPolicy
(
FVTableHelper& Helper |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | DecodeAndSampleActions
(
const float ActionNoiseScale |
Decodes and samples action vectors using the Decoder network. | |
| void | -- Blueprint public interface -- | ||
| void | Calling this function will run the underlying neural network on the previously encoded observations to populate the encoded actions. | ||
| ULearningAgentsNeuralNetwork * | Gets the current Encoder Network Asset being used | ||
| UE::Learning::FNeuralNetworkFunction & | Get a reference to this policy's decoder function object. | ||
| ULearningAgentsNeuralNetwork * | Gets the current Encoder Network Asset being used | ||
| UE::Learning::FNeuralNetworkFunction & | -- Non-blueprint public interface -- | ||
| void | GetMemoryState
(
TArray< float >& OutMemoryState, |
Gets the current memory state for a given agent as represented by an abstract vector learned by the policy. | |
| TLearningArrayView< 2, const float > | Get a const view to this policy's memory state. | ||
| int32 | Gets the size of the memory state | ||
| TLearningArrayView< 2, const float > | Get a const view to this policy's encoded observation vectors. | ||
| ULearningAgentsNeuralNetwork * | Gets the current Policy Network Asset being used | ||
| UE::Learning::FNeuralNetworkPolicy & | Get a reference to this policy's policy function object. | ||
| TLearningArrayView< 2, const float > | Get a const view to this policy's pre-evaluation memory state. | ||
| bool | HasEncodedObservationsForAgent
(
const int32 AgentId |
Returns true if this policy has encoded observations for the given agent id. Otherwise, false. | |
| ULearningAgentsPolicy * | MakePolicy
(
ULearningAgentsManager*& InManager, |
Constructs this object to be used with the given agent interactor and policy settings. | |
| void | OnAgentsAdded_Implementation
(
const TArray< int32 >& AgentIds |
||
| void | OnAgentsRemoved_Implementation
(
const TArray< int32 >& AgentIds |
||
| void | OnAgentsReset_Implementation
(
const TArray< int32 >& AgentIds |
||
| void | RunInference
(
const float ActionNoiseScale |
Calls GatherObservations, EncodeObservations, EvaluatePolicy, DecodeAndSampleActions, PerformActions | |
| void | SetMemoryState
(
const int32 AgentId, |
Sets the current memory state for a given agent as represented by an abstract vector learned by the policy. | |
| void | SetupPolicy
(
ULearningAgentsManager*& InManager, |
Initializes this object to be used with the given agent interactor and policy settings. |