unreal.PlanarPositionDifferencePenalty

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

Bases: LearningAgentsReward

A penalty for being far from a goal position in a plane.

C++ Source:

  • Plugin: LearningAgents

  • Module: LearningAgentsTraining

  • File: LearningAgentsRewards.h

Editor Properties: (see get_editor_property/set_editor_property)

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

classmethod add_planar_position_difference_penalty(agent_trainer, name='None', weight=1.000000, scale=100.000000, threshold=0.000000, axis0=[1.000000, 0.000000, 0.000000], axis1=[0.000000, 1.000000, 0.000000]) PlanarPositionDifferencePenalty

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

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

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

  • weight (float) – Multiplier for this penalty when being summed up for the total reward.

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

  • threshold (float) – Minimal distance to apply this penalty.

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

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

Returns:

The newly created reward.

Return type:

PlanarPositionDifferencePenalty

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

Sets the data for this penalty. Call during ULearningAgentsTrainer::SetRewards event.

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

  • position0 (Vector) – The current position.

  • position1 (Vector) – The goal position.