Class 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 Detail

      • DisplacementDeltaManager

        public DisplacementDeltaManager​(bio.singa.mathematics.vectors.Vector2D initialPosition)
        Creates a new Displacement Delta Manager.
        Parameters:
        initialPosition - The initial 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.