TypeBased

class TypeBased<T>(environment: Euclidean2DEnvironment<T>, node: Node<T>, typeWeights: Map<KClass<SteeringAction<T, Euclidean2DPosition>>, Double>, defaultWeight: Double = 0.0) : Weighted<T>

A Weighted steering strategy assigning weights based on actions' types; the client provides a weight for each action KClass.

Parameters

environment

the environment in which the node moves.

node

the owner of the steering actions combined by this strategy.

typeWeights

the map of weights for each steering action KClass.

defaultWeight

fallback weight used when an action's type is not present in typeWeights.

Type Parameters

T

the concentration type.

Constructors

Link copied to clipboard
constructor(environment: Euclidean2DEnvironment<T>, node: Node<T>, typeWeights: Map<KClass<SteeringAction<T, Euclidean2DPosition>>, Double>, defaultWeight: Double = 0.0)

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.