Package cnuphys.adaptiveSwim
Class AdaptiveLineStopper
java.lang.Object
cnuphys.adaptiveSwim.AAdaptiveStopper
cnuphys.adaptiveSwim.AdaptiveLineStopper
- All Implemented Interfaces:
- IAdaptiveStopper
- 
Field SummaryFields inherited from class cnuphys.adaptiveSwim.AAdaptiveStopper_accuracy, _dim, _hLast, _s, _sf, _THEMAXSTEP, _trajectory, _u
- 
Constructor SummaryConstructorsConstructorDescriptionAdaptiveLineStopper(double[] u0, double sf, Line targetLine, double accuracy, SwimTrajectory trajectory) Line stopper (does check max path length)
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidaccept(double snew, double[] unew) Accept a new integration stepbooleanstopIntegration(double snew, double[] unew) Given the current state of the integration, should we stop?Methods inherited from class cnuphys.adaptiveSwim.AAdaptiveStoppercopy, getMaxStepSize, getS, getSmax, getU, setMaxStep
- 
Constructor Details- 
AdaptiveLineStopperpublic AdaptiveLineStopper(double[] u0, double sf, Line targetLine, double accuracy, SwimTrajectory trajectory) Line stopper (does check max path length)- Parameters:
- u0- initial state vector
- sf- the maximum value of the path length in meters
- targetLine- the target line
- accuracy- the accuracy in meters
- trajectory- optional swim trajectory (can be null)
 
 
- 
- 
Method Details- 
stopIntegrationpublic boolean stopIntegration(double snew, double[] unew) Description copied from interface:IAdaptiveStopperGiven 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:
- trueif we should stop now.
 
- 
acceptprotected void accept(double snew, double[] unew) Accept a new integration step- Overrides:
- acceptin class- AAdaptiveStopper
- Parameters:
- snew- the new value of s in meters
- unew- the new state vector
 
 
-