Class RandomTarget
-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.movestrategies.TargetSelectionStrategy
,java.io.Serializable
public final class RandomTarget<T extends Object> extends ChangeTargetOnCollision<T, Euclidean2DPosition>
Selects a target based on a random direction extracted from directionRng, and a random distance extracted from distanceDistribution. getCurrentPosition should return the current position of the object to move. T is the type of the concentration of the node.
-
-
Constructor Summary
Constructors Constructor Description RandomTarget(Environment<T, Euclidean2DPosition> environment, Node<T> node, RandomGenerator directionRng, RealDistribution distanceDistribution)
Handy constructor for Alchemist where the object to move is a node in the environment. RandomTarget(Environment<T, Euclidean2DPosition> environment, Function0<Euclidean2DPosition> getCurrentPosition, Function2<Double, Double, Euclidean2DPosition> makePosition, RandomGenerator directionRng, RealDistribution distanceDistribution)
-
Method Summary
Modifier and Type Method Description RandomTarget<T>
cloneIfNeeded(Node<T> destination, Reaction<T> reaction)
-
-
Constructor Detail
-
RandomTarget
RandomTarget(Environment<T, Euclidean2DPosition> environment, Node<T> node, RandomGenerator directionRng, RealDistribution distanceDistribution)
Handy constructor for Alchemist where the object to move is a node in the environment.
-
RandomTarget
RandomTarget(Environment<T, Euclidean2DPosition> environment, Function0<Euclidean2DPosition> getCurrentPosition, Function2<Double, Double, Euclidean2DPosition> makePosition, RandomGenerator directionRng, RealDistribution distanceDistribution)
-
-
Method Detail
-
cloneIfNeeded
RandomTarget<T> cloneIfNeeded(Node<T> destination, Reaction<T> reaction)
-
-
-
-