Navigation
API > API/Plugins > API/Plugins/LearningAgents
Inheritance Hierarchy
- UActorComponent
- ULearningAgentsManager
References
| Module | LearningAgents |
| Header | /Engine/Plugins/Experimental/LearningAgents/Source/LearningAgents/Public/LearningAgentsManager.h |
| Include | #include "LearningAgentsManager.h" |
Syntax
UCLASS (BlueprintType, Blueprintable, Meta=(BlueprintSpawnableComponent))
class ULearningAgentsManager : public UActorComponent
Remarks
The agent manager is responsible for tracking which game objects are agents. It's the central class around which most of Learning Agents is built.
If you have multiple different types of objects you want controlled by Learning Agents, you should consider creating one agent manager per object type, rather than trying to share an agent manager.
Variables
| Type | Name | Description | |
|---|---|---|---|
| int32 | MaxAgentNum | Maximum number of agents. |
Constructors
| Type | Name | Description | |
|---|---|---|---|
| These constructors/destructors are needed to make forward declarations happy. | |||
ULearningAgentsManager
(
FVTableHelper& Helper |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| int32 | Adds the given object as an agent to the manager. | ||
| void | Adds the given objects as an agents to the manager. | ||
| void | AddListener
(
ULearningAgentsManagerListener* Listener |
Adds a listener to be tracked by this manager. | |
| UObject * | GetAgent
(
const int32 AgentId, |
Gets the agent with the given id. | |
| UObject * | Gets the agent corresponding to the given id. | ||
| const UObject * | -- Non-blueprint public interface -- | ||
| int32 | GetAgentId
(
UObject* Agent |
Gets the agent id associated with a given agent. | |
| void | GetAgentIds
(
TArray< int32 >& OutAgentIds, |
Gets the agent ids associated with a set of agents. | |
| int32 | GetAgentNum () |
Gets the number of agents added | |
| void | Gets the agents associated with a set of ids. | ||
| TConstArrayView< TObjectPtr< UObject > > | GetAgents () |
Get a const array view of this manager's agent objects. | |
| const TArray< int32 > & | Gets the set of agent ids currently added | ||
| void | GetAllAgents
(
TArray< UObject* >& OutAgents, |
Gets all added agents. | |
| UE::Learning::FIndexSet | Gets the set of agent ids currently added as an FIndexSet | ||
| int32 | -- Agent Management -- | ||
| bool | Returns true if the given id is an agent used by the manager; Otherwise, false. | ||
| bool | HasAgentObject
(
UObject* Agent |
Returns true if the given object is an agent used by the manager; Otherwise, false. | |
| void | OnRegister () |
||
| void | RemoveAgent
(
const int32 AgentId |
Removes the agent with the given id from the manager. | |
| void | RemoveAgents
(
const TArray< int32 >& AgentIds |
Removes the agents with the given ids from the manager. | |
| void | Removes all agents from the manager. | ||
| void | RemoveListener
(
ULearningAgentsManagerListener* Listener |
Removes a listener from being tracked by this manager. | |
| void | ResetAgent
(
const int32 AgentId |
Resets the agent with the given id on the manager. | |
| void | ResetAgents
(
const TArray< int32 >& AgentIds |
Resets the agents with the given ids on the manager. | |
| void | Resets all the agents on the manager. | ||
| void | TickComponent
(
float DeltaTime, |