TypeBased
class TypeBased<T>(environment: Euclidean2DEnvironment<T>, node: Node<T>, typeWeights: LinkedHashMap<KClass<SteeringAction<T, Euclidean2DPosition>>, Double>, defaultWeight: Double = 0.0) : Weighted<T> (source)
A Weighted steering strategy assigning weights based on actions' types (each type has its own weight, specified by the client).
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
typeWeights
the weight for each type of steering action.
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(environment: Euclidean2DEnvironment<T>, node: Node<T>, typeWeights: LinkedHashMap<KClass<SteeringAction<T, Euclidean2DPosition>>, Double>, defaultWeight: Double = 0.0)
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.