SinglePrevalent

class SinglePrevalent<T, N : ConvexPolygon>(environment: Euclidean2DEnvironmentWithGraph<*, T, N, *>, node: Node<T>, prevalent: SteeringActions<T>.() -> NavigationAction2D<T, *, *, N, *>, toleranceAngle: Double = DEFAULT_TOLERANCE_ANGLE, alpha: Double = DEFAULT_ALPHA, maxWalk: () -> Double, maxWalkRatio: Double = DEFAULT_MAX_WALK_RATIO, delta: Double = DEFAULT_DELTA) : Weighted<T>

A SteeringStrategy in which one navigation action is prevalent and others are combined with a reduced weight so that the resulting force stays within a tolerance sector around the prevalent force while remaining inside the current room.

The steps are:

  1. Identify the prevalent navigation action (must be a NavigationAction).

  2. If the prevalent action leads outside the current room, it is used unchanged.

  3. Otherwise, linearly combine the prevalent force (weight 1) and the other forces (weight w ∈ 0,1) and reduce w until the combined force is within the tolerance angle and keeps the node inside the room.

  4. Apply exponential smoothing to reduce oscillations.

Parameters

environment

the environment with navigation graph.

node

the node owning the steering strategy.

prevalent

function selecting the prevalent NavigationAction.

toleranceAngle

tolerance angle in radians.

alpha

smoothing alpha for exponential smoothing.

maxWalk

function computing the maximum allowed walk distance.

maxWalkRatio

minimum magnitude ratio for the resulting force.

delta

decrement step used when searching for a suitable weight w.

Type Parameters

T

the concentration type.

N

the polygon type used by the environment's navigation graph.

Constructors

Link copied to clipboard
constructor(environment: Euclidean2DEnvironmentWithGraph<*, T, N, *>, node: Node<T>, prevalent: SteeringActions<T>.() -> NavigationAction2D<T, *, *, N, *>, toleranceAngle: Double = DEFAULT_TOLERANCE_ANGLE, alpha: Double = DEFAULT_ALPHA, maxWalk: () -> Double, maxWalkRatio: Double = DEFAULT_MAX_WALK_RATIO, delta: Double = DEFAULT_DELTA)

Types

Link copied to clipboard
object Companion

Default values for the parameters.

Functions

Link copied to clipboard

actions are partitioned in group steering actions and non-group steering actions. The overall next position for each of these two sets of actions is computed via weighted sum. The resulting vectors are then summed together (with unitary weight).

Link copied to clipboard

If there's no SteeringActionWithTarget among the provided actions, a zero vector is returned. Otherwise, the closest target is picked.