GloballyConstantSpeed

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.

Constructors

Link copied to clipboard
constructor(reaction: NodeReaction<*>, maxSpeed: Double)

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
open override fun getNodeMovementLength(target: P?): Double

Computes the movement length toward target.