Class DisplacementDeltaManager
- java.lang.Object
-
- bio.singa.simulation.model.modules.displacement.DisplacementDeltaManager
-
public class DisplacementDeltaManager extends Object
The DisplacementDeltaManager handles the current position an updatable amd the updates to this position during simulation.- Author:
- cl
-
-
Constructor Summary
Constructors Constructor Description DisplacementDeltaManager(bio.singa.mathematics.vectors.Vector2D initialPosition)Creates a new Displacement Delta Manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPotentialDisplacementDelta(DisplacementDelta delta)Adds a displacement delta.bio.singa.mathematics.vectors.Vector2DcalculateTotalDisplacement()Calculates the total displacement resulting from the potential deltas and sets the result as the next position.voidclearPotentialDisplacementDeltas()Clears all potential displacement deltas.bio.singa.mathematics.vectors.Vector2DgetCurrentPosition()Returns the current position.bio.singa.mathematics.vectors.Vector2DgetNextPosition()Returns the next position.Optional<DisplacementDelta>getPotentialDisplacementDelta(DisplacementBasedModule module)Returns a specific delta applied by the given module.List<DisplacementDelta>getPotentialDisplacementDeltas()Returns the potential displacement deltas.voidresetNextPosition()Resets the next position to the current position.voidupdatePosition()Sets the current position to the next position.
-
-
-
Method Detail
-
getCurrentPosition
public bio.singa.mathematics.vectors.Vector2D getCurrentPosition()
Returns the current position.- Returns:
- The current position.
-
getPotentialDisplacementDeltas
public List<DisplacementDelta> getPotentialDisplacementDeltas()
Returns the potential displacement deltas.- Returns:
- The current displacement deltas.
-
getPotentialDisplacementDelta
public Optional<DisplacementDelta> getPotentialDisplacementDelta(DisplacementBasedModule module)
Returns a specific delta applied by the given module.- Parameters:
module- The module.- Returns:
- The displacement delta.
-
addPotentialDisplacementDelta
public void addPotentialDisplacementDelta(DisplacementDelta delta)
Adds a displacement delta.- Parameters:
delta- The displacement delta.
-
clearPotentialDisplacementDeltas
public void clearPotentialDisplacementDeltas()
Clears all potential displacement deltas.
-
calculateTotalDisplacement
public bio.singa.mathematics.vectors.Vector2D calculateTotalDisplacement()
Calculates the total displacement resulting from the potential deltas and sets the result as the next position.- Returns:
- The next position.
-
getNextPosition
public bio.singa.mathematics.vectors.Vector2D getNextPosition()
Returns the next position.- Returns:
- The next position.
-
resetNextPosition
public void resetNextPosition()
Resets the next position to the current position.
-
updatePosition
public void updatePosition()
Sets the current position to the next position.
-
-