Polarith AI
1.8
Reduction Class Reference

Description

Reduction is intended to reduce the magnitudes of the TargetObjective under certain conditions (back-end class).

It extends PerceptBehaviour<T>. This might be used to reduce the velocity of a character when it gets close to its target or to a possible obstacle. The reduction conditions are given by the proximity to the current percept and the angle between the movement direction of the agent and the direction towards the percept. The balance between these two conditions can be controlled with the AngleWeight parameter.

In order to make this behaviour work, the ValueWriting should be set to ValueWritingType.AssignLesser or ValueWritingType.Multiplication. Other configurations might also be possible, however, they will lead to different and maybe unexpected results.

Back-end class of AIMReduction. This behaviour is thread-safe.

Inheritance diagram for Reduction:
PerceptBehaviour< SteeringPercept >

Public Fields

ValueWritingType ValueWriting = ValueWritingType.AssignLesser
 Sets the type for writing objective values. More...
 
bool UseSensorProjection = true
 If true, Sensor.ProjectionMode is used as VectorProjection. More...
 
VectorProjectionType VectorProjection
 Sets the type for projecting the perceived vector data into a plane. More...
 
MappingType DistanceMapping = MappingType.InverseQuadratic
 Determines how the resulting magnitude is mapped according to the set MaxDistance. More...
 
int TargetObjective
 Defines the objective for writing values. More...
 
float MagnitudeMultiplier = 1f
 Is multiplied to the resulting magnitude. More...
 
float MaxDistance = 5f
 The maximum radius for considering percepts. More...
 
float MinMagnitude
 This value is added to the final result. More...
 
float AngleWeight = 0.25f
 This parameter determines how the two conditions are combined which influence the result of this behaviour. More...
 
bool UsePresetVelocity = false
 If true, a game object's rotation and PresetVelocity direction is used to approximate its actual velocity. More...
 
PresetVelocityType PresetVelocity = PresetVelocityType.Automatic
 Specifies the forward direction the agent moves towards and/or looks at by default. More...
 
PredictionType Prediction = PredictionType.None
 If set to anything other than PredictionType.None, the position of the Self percept is updated according to the given velocity. More...
 
float PredictionMagnitude = 0.0f
 Scales the velocity vector used for predicting the possible future position of an agent if Prediction is set to PredictionType.PredictionMagnitude. More...
 
readonly IList< T > Percepts
 All percepts which are relevant for an agent. More...
 

Protected Fields

Vector3 velocity = Vector3.forward
 The forward direction the agent moves towards and/or looks at by default. More...
 

Properties

override SteeringPercept Self [get, set]
 The data of the associated agent itself. More...
 

Public Methods

override void Behave ()
 This method executes the main algorithm of this behaviour and is called within Context.Evaluate in order to set/modify objective values for the associated Context.Problem. More...
 
Imprint