Class AdaptiveCylinderStopper

java.lang.Object
cnuphys.adaptiveSwim.AAdaptiveStopper
cnuphys.adaptiveSwim.AdaptiveCylinderStopper
All Implemented Interfaces:
IAdaptiveStopper

public class AdaptiveCylinderStopper extends AAdaptiveStopper
  • Constructor Details

    • AdaptiveCylinderStopper

      public AdaptiveCylinderStopper(double[] u0, double sf, Cylinder targetCylinder, double accuracy, SwimTrajectory trajectory)
      Cylinder stopper (does check max path length)
      Parameters:
      u0 - initial state vector
      sf - the maximum value of the path length in meters
      targetCylinder - the target cylinder
      accuracy - the accuracy in meters
      trajectory - optional swim trajectory (can be null)
  • Method Details

    • stopIntegration

      public boolean stopIntegration(double snew, double[] unew)
      Description copied from interface: IAdaptiveStopper
      Given the current state of the integration, should we stop? This allows the integration to stop, for example, if some distance from the origin has been exceeded or if the independent variable passes some threshold. It won't be precise, because the check may not happen on every step, but it should be close.
      Returns:
      true if we should stop now.
    • getDistance

      public double getDistance()
      Get the current value of the distance (positive definite)
      Returns:
      the current value of distance
    • crossedBoundary

      public boolean crossedBoundary()
      Did we cross the boundary?
      Returns:
      true if we crossed the boundary
    • passedSmax

      public boolean passedSmax()
      Did we pas the max path length?
      Returns:
      true if we crossed the boundary