Weighted

open class Weighted<T>(environment: Euclidean2DEnvironment<T>, pedestrian: Pedestrian2D<T>, weight: SteeringAction<T, Euclidean2DPosition>.() -> Double) : SteeringStrategy<T, Euclidean2DPosition>

A SteeringStrategy performing a weighted sum of steering actions (see computeNextPosition).

Parameters

environment
    the environment in which the pedestrian moves.
pedestrian
    the owner of the steering actions combined by this strategy.
weight
    lambda used to assign a weight to each steering action: the higher the weight, the greater the
    importance of the action.

Constructors

Link copied to clipboard
fun <T> Weighted(environment: Euclidean2DEnvironment<T>, pedestrian: Pedestrian2D<T>, weight: SteeringAction<T, Euclidean2DPosition>.() -> Double)

Functions

Link copied to clipboard
open override fun computeNextPosition(actions: List<SteeringAction<T, Euclidean2DPosition>>): Euclidean2DPosition

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
open override fun computeTarget(actions: List<SteeringAction<T, Euclidean2DPosition>>): Euclidean2DPosition

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

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard