Package it.unibo.alchemist.model.implementations.actions.steeringstrategies

Types

Link copied to clipboard
class DistanceWeighted<T>(environment: Euclidean2DEnvironment<T>, pedestrian: Pedestrian2D<T>, defaultWeight: Double) : Weighted<T>

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.

Link copied to clipboard
class ExponentialSmoothing<V : Vector<V>>(alpha: Double)

Exponential smoothing is a trivial way of smoothing signals. Let s(t) be the smoothed signal at time t, given a discrete signal g: s(t) = alpha * g(t) + (1 - alpha) * s(t-1) s(0) = g(0)

Link copied to clipboard
open class Filtered<T, P : Position<P>, Vector<P>>(steerStrategy: SteeringStrategy<T, P>, filter: List<SteeringAction<T, P>>.() -> List<SteeringAction<T, P>>) : SteeringStrategy<T, P>

SteeringStrategy decorator applying a filter to the list of steering actions (see computeNextPosition).

Link copied to clipboard
class Nearest<T>(environment: Euclidean2DEnvironment<T>, pedestrian: Pedestrian2D<T>) : Filtered<T, Euclidean2DPosition>

Filtered strategy considering only the group steering action and the non-group steering action whose targets are nearest to the pedestrian's position. The two actions are combined using DistanceWeighted strategy.

Link copied to clipboard
class SinglePrevalent<T, N : ConvexPolygon>(environment: Euclidean2DEnvironmentWithGraph<*, T, N, *>, pedestrian: Pedestrian2D<T>, prevalent: SteeringActions<T>.() -> NavigationAction2D<T, *, *, N, *>, toleranceAngle: Double, alpha: Double, maxWalk: () -> Double, maxWalkRatio: Double, delta: Double) : Weighted<T>

A SteeringStrategy in which one action is prevalent. Only NavigationActions can be prevalent, because they guarantee to navigate the environment consciously (e.g. without getting stuck in obstacles). The purpose of this strategy is to linearly combine the potentially contrasting forces to which the pedestrian is subject, while maintaining that warranty. Such forces are combined as follows: let f be the prevalent force,

Link copied to clipboard
class TypeBased<T>(environment: Euclidean2DEnvironment<T>, pedestrian: Pedestrian2D<T>, typeWeights: LinkedHashMap<KClass<SteeringAction<T, Euclidean2DPosition>>, Double>, defaultWeight: Double) : Weighted<T>

A Weighted steering strategy assigning weights based on actions' types (each type has its own weight, specified by the client).

Link copied to clipboard
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).

Functions

Link copied to clipboard

Picks the SteeringActionWithTarget whose target is nearest to the pedestrian's current position, or the first action of the list if none of them has a defined target. If the list is empty, null is returned.

Link copied to clipboard
fun <T, P : Position<P>, Vector<P>> SteeringActionWithTarget<T, P>.targetDistanceTo(node: Node<T>, env: Environment<T, P>): Double

Computes the distance between this action's target and the given node.