unreal.ScalarVelocityReward

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

Bases: LearningAgentsReward

A reward for maximizing speed.

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_scalar_velocity_reward(agent_trainer, name='None', weight=1.000000, scale=200.000000) ScalarVelocityReward

Adds a new scalar velocity reward to the given trainer. Call during ULearningAgentsTrainer::SetupRewards event.

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

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

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

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

Returns:

The newly created reward.

Return type:

ScalarVelocityReward

set_scalar_velocity_reward(agent_id=-1, velocity) None

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

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

  • velocity (float) – The current scalar velocity.