-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.interfaces.movestrategies.SpeedSelectionStrategy,java.io.Serializable
public final class ConstantSpeed<T, P extends Position<P>> implements SpeedSelectionStrategy<T, P>
This strategy makes the node move at an average constant speed, which is influenced by the it.unibo.alchemist.model.interfaces.TimeDistribution of the Reaction hosting this it.unibo.alchemist.model.interfaces.Action. This action tries to normalize on the Reaction rate, but if the it.unibo.alchemist.model.interfaces.TimeDistribution has a high variance, the movements on the map will inherit this tract.
-
-
Constructor Summary
Constructors Constructor Description ConstantSpeed(Reaction<out Object> reaction, double speed)
-
Method Summary
Modifier and Type Method Description doublegetNodeMovementLength(P target)ConstantSpeed<T, P>cloneIfNeeded(Node<T> destination, Reaction<T> reaction)-
-
Method Detail
-
getNodeMovementLength
double getNodeMovementLength(P target)
- Parameters:
target- the Position describing where the it.unibo.alchemist.model.interfaces.Node is directed
-
cloneIfNeeded
ConstantSpeed<T, P> cloneIfNeeded(Node<T> destination, Reaction<T> reaction)
-
-
-
-