Distance Weighted
class DistanceWeighted<T>(environment: Euclidean2DEnvironment<T>, pedestrian: Pedestrian2D<T>, defaultWeight: Double) : Weighted<T>
Content copied to clipboard
Weighted strategy where the weight of each steering action is the inverse of the pedestrian's distance from the action's target (the closer the target, the more important the action). defaultWeight is used for actions without a target.
Parameters
environment
the environment in which the pedestrian moves.
Content copied to clipboard
pedestrian
the owner of the steering action this strategy belongs to.
Content copied to clipboard
Constructors
Link copied to clipboard
fun <T> DistanceWeighted(environment: Euclidean2DEnvironment<T>, pedestrian: Pedestrian2D<T>, defaultWeight: Double = 1.0)
Content copied to clipboard
Functions
Link copied to clipboard
open override fun computeNextPosition(actions: List<SteeringAction<T, Euclidean2DPosition>>): Euclidean2DPosition
Content 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
open override fun computeTarget(actions: List<SteeringAction<T, Euclidean2DPosition>>): Euclidean2DPosition
Content copied to clipboard
If there's no SteeringActionWithTarget among the provided actions, a zero vector is returned. Otherwise, the closest target is picked.