GloballyConstantSpeed
class GloballyConstantSpeed<T, P : Position<P>>(reaction: NodeReaction<*>, maxSpeed: Double) : SpeedSelectionStrategy<T, P> (source)
Similar to ConstantSpeed, but takes into consideration the mean delay of the time distribution instead of the rate of the reaction: every movement covers the distance traveled at maxSpeed in the expected time between two occurrences. The mean delay must be finite and positive, both when this strategy is built and at every movement.
Functions
Link copied to clipboard
open override fun cloneIfNeeded(destination: Node<T>, reaction: NodeReaction<T>): GloballyConstantSpeed<T, P>
Returns a clone for destination and reaction when the strategy is stateful.
Link copied to clipboard
Computes the movement length toward target.