unreal.PlanarPositionSimilarityCompletion

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

Bases: LearningAgentsCompletion

A completion for if two positions are near by some threshold in a plane, e.g. if the agent gets close to a position.

C++ Source:

  • Plugin: LearningAgents

  • Module: LearningAgentsTraining

  • File: LearningAgentsCompletions.h

Editor Properties: (see get_editor_property/set_editor_property)

  • agent_trainer (LearningAgentsTrainer): [Read-Only] Reference to the Trainer this completion is associated with.

classmethod add_planar_position_similarity_completion(agent_trainer, name='None', threshold=100.000000, completion_mode=LearningAgentsCompletionEnum.TERMINATION, axis0=[1.000000, 0.000000, 0.000000], axis1=[0.000000, 1.000000, 0.000000]) PlanarPositionSimilarityCompletion

Adds a new planar position difference completion to the given trainer. The axis parameters define the plane. Call during ULearningAgentsTrainer::SetupCompletions event.

Parameters:
  • agent_trainer (LearningAgentsTrainer) – The trainer to add this completion to.

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

  • threshold (float) – If the distance becomes greater than this threshold, then the episode will complete.

  • completion_mode (LearningAgentsCompletionEnum) – The completion mode.

  • axis0 (Vector) – The forward axis of the plane.

  • axis1 (Vector) – The right axis of the plane.

Returns:

The newly created completion.

Return type:

PlanarPositionSimilarityCompletion

set_planar_position_similarity_completion(agent_id=-1, position0, position1) None

Sets the data for this completion. Call during ULearningAgentsTrainer::SetCompletions event.

Parameters:
  • agent_id (int32) – The agent id this data corresponds to.

  • position0 (Vector) – The first position.

  • position1 (Vector) – The second position.