unreal.FloatArrayAction

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

Bases: LearningAgentsAction

A simple float array action. Used as a catch-all for situations where a more type-specific action does not exist yet.

C++ Source:

  • Plugin: LearningAgents

  • Module: LearningAgents

  • File: LearningAgentsActions.h

Editor Properties: (see get_editor_property/set_editor_property)

  • interactor (LearningAgentsInteractor): [Read-Only] Reference to the Interactor this action is associated with.

classmethod add_float_array_action(interactor, name='None', num=1, scale=1.000000) FloatArrayAction

Adds a new float array action to the given agent interactor. Call during ULearningAgentsInteractor::SetupActions event.

Parameters:
  • interactor (LearningAgentsInteractor) – The agent interactor to add this action to.

  • name (Name) – The name of this new action. Used for debugging.

  • num (int32) – The number of floats in the array

  • scale (float) – Used to normalize the data for the action.

Returns:

The newly created action.

Return type:

FloatArrayAction

get_float_array_action(agent_id=-1) Array[float]

Gets the data for this action. Call during ULearningAgentsInteractor::GetActions event.

Parameters:

agent_id (int32) – The agent id to get data for.

Returns:

out_values (Array[float]): The output array of floats

Return type:

Array[float]

set_float_array_action(agent_id=-1, values) None

Sets the data for this action. Call during ULearningAgentsController::SetActions event.

Parameters:
  • agent_id (int32) – The agent id to set data for.

  • values (Array[float]) – The current action values.