unreal.LearningAgentsManagerComponent

class unreal.LearningAgentsManagerComponent(outer: Object | None = None, name: Name | str = 'None')

Bases: ActorComponent

Base class for components which can be attached to an ALearningAgentsManager.

C++ Source:

  • Plugin: LearningAgents

  • Module: LearningAgents

  • File: LearningAgentsManagerComponent.h

Editor Properties: (see get_editor_property/set_editor_property)

  • asset_user_data (Array[AssetUserData]): [Read-Write] Array of user data stored with the component

  • auto_activate (bool): [Read-Write] Whether the component is activated at creation or must be explicitly activated.

  • can_ever_affect_navigation (bool): [Read-Write] Whether this component can potentially influence navigation

  • component_tags (Array[Name]): [Read-Write] Array of tags that can be used for grouping and categorizing. Can also be accessed from scripting.

  • editable_when_inherited (bool): [Read-Write] True if this component can be modified when it was inherited from a parent actor class

  • helper_objects (Array[LearningAgentsHelper]): [Read-Only] The list of current helper objects.

  • is_editor_only (bool): [Read-Write] If true, the component will be excluded from non-editor builds

  • is_setup (bool): [Read-Only] True if this component has been setup. Otherwise, false.

  • manager (LearningAgentsManager): [Read-Only] The associated manager this component is attached to.

  • on_component_activated (ActorComponentActivatedSignature): [Read-Write] Called when the component has been activated, with parameter indicating if it was from a reset

  • on_component_deactivated (ActorComponentDeactivateSignature): [Read-Write] Called when the component has been deactivated

  • primary_component_tick (ActorComponentTickFunction): [Read-Write] Main tick function for the Component

  • replicate_using_registered_sub_object_list (bool): [Read-Write] When true the replication system will only replicate the registered subobjects list When false the replication system will instead call the virtual ReplicateSubObjects() function where the subobjects need to be manually replicated.

  • replicates (bool): [Read-Write] Is this component currently replicating? Should the network code consider it for replication? Owning Actor must be replicating first!

agents_added(agent_ids) None

During this event, any additional logic required for when agents are added can be executed.

Parameters:

agent_ids (Array[int32]) –

agents_removed(agent_ids) None

During this event, any additional logic required for when agents are removed can be executed.

Parameters:

agent_ids (Array[int32]) –

agents_reset(agent_ids) None

During this event, any additional logic required for when agents are reset can be executed.

Parameters:

agent_ids (Array[int32]) –

get_agent(agent_id=-1, agent_class) Object

Gets the agent with the given id from the manager. Calling this from blueprint with the appropriate AgentClass will automatically cast the object to the given type. If not in a blueprint, you should call the manager’s GetAgent methods directly.

Parameters:
  • agent_id (int32) – The id of the agent to get.

  • agent_class (type(Class)) – The class to cast the agent object to (in blueprint).

Returns:

The agent object.

Return type:

Object

get_agent_manager(agent_manager_class) LearningAgentsManager

Gets the agent manager associated with this component.

Parameters:

agent_manager_class (type(Class)) –

Return type:

LearningAgentsManager

get_agents(agent_ids, agent_class) Array[Object]

Gets the agents associated with a set of ids from the manager. Calling this from blueprint with the appropriate AgentClass will automatically cast the object to the given type. If not in a blueprint, you should call the manager’s GetAgents method directly.

Parameters:
  • agent_ids (Array[int32]) – The ids of the agents to get.

  • agent_class (type(Class)) – The class to cast the agent objects to (in blueprint).

Returns:

out_agents (Array[Object]): The output array of agent objects.

Return type:

Array[Object]

get_all_agents(agent_class) -> (out_agents=Array[Object], out_agent_ids=Array[int32])

Gets all added agents from the manager. Calling this from blueprint with the appropriate AgentClass will automatically cast the object to the given type.

Parameters:

agent_class (type(Class)) – The class to cast the agent objects to (in blueprint).

Returns:

out_agents (Array[Object]): The output array of agent objects.

out_agent_ids (Array[int32]): The output array of agent ids.

Return type:

tuple

is_setup() bool

Returns true if this component has been setup. Otherwise, false.

Return type:

bool