ConstantSpeed

class ConstantSpeed<T, P : Position<P>>(reaction: NodeReaction<*>, speed: Double) : SpeedSelectionStrategy<T, P> (source)

This strategy makes the node move at an average constant speed, which is influenced by the it.unibo.alchemist.model.TimeDistribution of the TimeDistributedReaction hosting this it.unibo.alchemist.model.Action. This action tries to normalize on the reaction rate, but if the it.unibo.alchemist.model.TimeDistribution has a high variance, the movements on the map will inherit this tract.

Parameters

reaction

the reaction used to compute movement timing

speed

the speed, in meters/second

Type Parameters

T

Concentration type

P

Position type

Constructors

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

Functions

Link copied to clipboard
open override fun cloneIfNeeded(destination: Node<T>, reaction: NodeReaction<T>): ConstantSpeed<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.