Polarith AI
1.8

◆ Behave()

override void Behave ( )
inherited

This method executes the main context steering algorithm and is called within Context.Evaluate in order to set/modify objective values for the associated Context.Problem.

It pre-caches multiple references for quick access in the three called steering methods, projects vector data as specified with VectorProjection and finally obtain/write objective values based on the set ValueMapping and ValueWriting.

For each existing instance in PerceptBehaviour<T>.Percepts, the ResultDirection and ResultMagnitude are used for obtaining the objective values so that they need to be set through the implementation of StartSteering, PerceptSteering and ReceptorSteering in derived SteeringBehaviour classes.

The final objective value which is written for one corresponding receptor is a sum which is obtained by weighting the angle between the ResultDirection and receptor direction, considering the ResultMagnitude and, optionally, the SteeringPercept.Significance.

Exceptions
NullReferenceExceptionIf the inherited MoveBehaviour.Context or its associated Context.Problem respectively Context<TValue, TStructure>.Sensor are null.
Imprint