Weighted
open class Weighted<T>(environment: Euclidean2DEnvironment<T>, node: Node<T>, weight: SteeringAction<T, Euclidean2DPosition>.() -> Double) : SteeringStrategy<T, Euclidean2DPosition> (source)
A SteeringStrategy performing a weighted sum of steering actions (see computeNextPosition).
Parameters
environment
the environment in which the node moves.
Content copied to clipboard
node
the owner of the steering actions combined by this strategy.
Content copied to clipboard
weight
lambda used to assign a weight to each steering action: the higher the weight, the greater the
importance of the action.
Content copied to clipboard
Inheritors
Constructors
Link copied to clipboard
constructor(environment: Euclidean2DEnvironment<T>, node: Node<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.