Class AAdaptiveStopper

java.lang.Object
cnuphys.adaptiveSwim.AAdaptiveStopper
All Implemented Interfaces:
IAdaptiveStopper
Direct Known Subclasses:
AdaptiveCylinderStopper, AdaptiveDefaultStopper, AdaptiveLineStopper, AdaptivePlaneStopper, AdaptiveRhoStopper, AdaptiveSphereStopper, AdaptiveSStopper, AdaptiveZStopper

public abstract class AAdaptiveStopper extends Object implements IAdaptiveStopper
  • Field Details

    • _THEMAXSTEP

      protected static final double _THEMAXSTEP
      See Also:
    • _accuracy

      protected final double _accuracy
    • _s

      protected double _s
    • _sf

      protected final double _sf
    • _dim

      protected final int _dim
    • _u

      protected double[] _u
    • _hLast

      protected double _hLast
    • _trajectory

      protected SwimTrajectory _trajectory
  • Constructor Details

    • AAdaptiveStopper

      public AAdaptiveStopper(double[] u0, double sf, double accuracy, SwimTrajectory trajectory)
      Create an stopper
      Parameters:
      u0 - the initial state vector
      sf - the maximum value of the pathlength in meters
      accuracy - the required accuracy in meters
      trajectory - an optional trajectory
  • Method Details

    • getS

      public double getS()
      Get the current path length
      Specified by:
      getS in interface IAdaptiveStopper
      Returns:
      the current path length in meters
    • getU

      public double[] getU()
      Get the current state vector
      Specified by:
      getU in interface IAdaptiveStopper
      Returns:
      the current state vector
    • accept

      protected void accept(double snew, double[] unew)
      Accept a new integration step
      Parameters:
      snew - the new value of s in meters
      unew - the new state vector
    • getSmax

      public double getSmax()
      Get the max or final value of the path length in meters
      Specified by:
      getSmax in interface IAdaptiveStopper
      Returns:
      the max or final value of the path length
    • copy

      protected void copy(double[] uSrc, double[] uDest)
      Copy a state vector
      Parameters:
      uSrc - the source
      uDest - the destination
    • getMaxStepSize

      public double getMaxStepSize()
      Get the max step size. This can vary with conditions, primarily with the proximity to a target
      Specified by:
      getMaxStepSize in interface IAdaptiveStopper
      Returns:
      the current max step in meters
    • setMaxStep

      protected void setMaxStep(double maxStep)
      Set the current max step
      Parameters:
      maxStep - the current max step in meters