Class GloballyConstantSpeed
-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.movestrategies.SpeedSelectionStrategy
,java.io.Serializable
public final class GloballyConstantSpeed<T extends Object, P extends Position<P>> implements SpeedSelectionStrategy<T, P>
Similar to ConstantSpeed but takes in consideration the time distribution's rate instead of the reaction's rate.
-
-
Constructor Summary
Constructors Constructor Description GloballyConstantSpeed(Reaction<?> reaction, Double maxSpeed)
-
Method Summary
Modifier and Type Method Description Double
getNodeMovementLength(P target)
GloballyConstantSpeed<T, P>
cloneIfNeeded(Node<T> destination, Reaction<T> reaction)
-
-
Method Detail
-
getNodeMovementLength
Double getNodeMovementLength(P target)
- Returns:
the current node's movement. The returned value represents a length.
-
cloneIfNeeded
GloballyConstantSpeed<T, P> cloneIfNeeded(Node<T> destination, Reaction<T> reaction)
- Returns:
A copy of the strategy if the strategy is stateful, and this object otherwise. The default implementation assumes a stateless strategy.
-
-
-
-