-
- All Implemented Interfaces:
-
it.unibo.alchemist.model.interfaces.movestrategies.SpeedSelectionStrategy,java.io.Serializable
public final class InteractWithOthers<T, P extends Position<out P>> implements SpeedSelectionStrategy<T, P>
This strategy slows down nodes depending on how many "interacting" nodes are found in the surroundings. It is an attempt at modeling crowding slow-downs.
-
-
Constructor Summary
Constructors Constructor Description InteractWithOthers(Environment<T, P> environment, Node<T> n, Reaction<T> reaction, Molecule interactingMolecule, double speed, double radius, double interaction)
-
Method Summary
Modifier and Type Method Description doublegetNodeMovementLength(P target)SpeedSelectionStrategy<T, P>cloneIfNeeded(Node<T> destination, Reaction<T> reaction)-
-
Constructor Detail
-
InteractWithOthers
InteractWithOthers(Environment<T, P> environment, Node<T> n, Reaction<T> reaction, Molecule interactingMolecule, double speed, double radius, double interaction)
- Parameters:
environment- the environmentn- the nodereaction- the reactioninteractingMolecule- the molecule that identifies an interacting nodespeed- the normal speed of the noderadius- the radius where to search for interacting nodesinteraction- the interaction factor.
-
-
Method Detail
-
getNodeMovementLength
double getNodeMovementLength(P target)
- Parameters:
target- the Position describing where the it.unibo.alchemist.model.interfaces.Node is directed
-
cloneIfNeeded
SpeedSelectionStrategy<T, P> cloneIfNeeded(Node<T> destination, Reaction<T> reaction)
-
-
-
-