Class AbstractDetector<T extends AbstractDetector<T>>
- java.lang.Object
-
- org.orekit.propagation.events.AbstractDetector<T>
-
- Type Parameters:
T
- type of the detector
- All Implemented Interfaces:
EventDetector
- Direct Known Subclasses:
AlignmentDetector
,AltitudeDetector
,AngularSeparationDetector
,AngularSeparationFromSatelliteDetector
,ApsideDetector
,BooleanDetector
,DateDetector
,EclipseDetector
,ElevationDetector
,ElevationExtremumDetector
,EventEnablingPredicateFilter
,EventShifter
,EventSlopeFilter
,ExtremumApproachDetector
,FieldOfViewDetector
,FootprintOverlapDetector
,FunctionalDetector
,GeographicZoneDetector
,GroundAtNightDetector
,GroundFieldOfViewDetector
,HaloXZPlaneCrossingDetector
,ImpulseManeuver
,InterSatDirectViewDetector
,LatitudeCrossingDetector
,LatitudeExtremumDetector
,LongitudeCrossingDetector
,LongitudeExtremumDetector
,MagneticFieldDetector
,NegateDetector
,NodeDetector
,ParameterDrivenDateIntervalDetector
,PositionAngleDetector
public abstract class AbstractDetector<T extends AbstractDetector<T>> extends Object implements EventDetector
Common parts shared by several orbital events finders.- Author:
- Luc Maisonobe
- See Also:
Propagator.addEventDetector(EventDetector)
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_MAX_ITER
Default maximum number of iterations in the event time search.static double
DEFAULT_MAXCHECK
Default maximum checking interval (s).static double
DEFAULT_THRESHOLD
Default convergence threshold (s).
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDetector(double maxCheck, double threshold, int maxIter, EventHandler handler)
Build a new instance.protected
AbstractDetector(AdaptableInterval maxCheck, double threshold, int maxIter, EventHandler handler)
Build a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract T
create(AdaptableInterval newMaxCheck, double newThreshold, int newMaxIter, EventHandler newHandler)
Build a new instance.abstract double
g(SpacecraftState s)
Compute the value of the switching function.EventHandler
getHandler()
Get the handler.AdaptableInterval
getMaxCheckInterval()
Get maximal time interval between switching function checks.int
getMaxIterationCount()
Get maximal number of iterations in the event time search.double
getThreshold()
Get the convergence threshold in the event time search.void
init(SpacecraftState s0, AbsoluteDate t)
Initialize event handler at the start of a propagation.boolean
isForward()
Check if the current propagation is forward or backward.T
withHandler(EventHandler newHandler)
Setup the event handler to call at event occurrences.T
withMaxCheck(double newMaxCheck)
Setup the maximum checking interval.T
withMaxCheck(AdaptableInterval newMaxCheck)
Setup the maximum checking interval.T
withMaxIter(int newMaxIter)
Setup the maximum number of iterations in the event time search.T
withThreshold(double newThreshold)
Setup the convergence threshold.
-
-
-
Field Detail
-
DEFAULT_MAXCHECK
public static final double DEFAULT_MAXCHECK
Default maximum checking interval (s).- See Also:
- Constant Field Values
-
DEFAULT_THRESHOLD
public static final double DEFAULT_THRESHOLD
Default convergence threshold (s).- See Also:
- Constant Field Values
-
DEFAULT_MAX_ITER
public static final int DEFAULT_MAX_ITER
Default maximum number of iterations in the event time search.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractDetector
protected AbstractDetector(double maxCheck, double threshold, int maxIter, EventHandler handler)
Build a new instance.- Parameters:
maxCheck
- maximum checking interval, must be strictly positive (s)threshold
- convergence threshold (s)maxIter
- maximum number of iterations in the event time searchhandler
- event handler to call at event occurrences
-
AbstractDetector
protected AbstractDetector(AdaptableInterval maxCheck, double threshold, int maxIter, EventHandler handler)
Build a new instance.- Parameters:
maxCheck
- maximum checking intervalthreshold
- convergence threshold (s)maxIter
- maximum number of iterations in the event time searchhandler
- event handler to call at event occurrences- Since:
- 12.0
-
-
Method Detail
-
init
public void init(SpacecraftState s0, AbsoluteDate t)
Initialize event handler at the start of a propagation.This method is called once at the start of the propagation. It may be used by the event handler to initialize some internal data if needed.
The default implementation does nothing
This implementation sets the direction of propagation and initializes the event handler. If a subclass overrides this method it should call
super.init(s0, t)
.- Specified by:
init
in interfaceEventDetector
- Parameters:
s0
- initial statet
- target time for the integration
-
g
public abstract double g(SpacecraftState s)
Compute the value of the switching function. This function must be continuous (at least in its roots neighborhood), as the integrator will need to find its roots to locate the events.- Specified by:
g
in interfaceEventDetector
- Parameters:
s
- the current state information: date, kinematics, attitude- Returns:
- value of the switching function
-
getMaxCheckInterval
public AdaptableInterval getMaxCheckInterval()
Get maximal time interval between switching function checks.- Specified by:
getMaxCheckInterval
in interfaceEventDetector
- Returns:
- maximal time interval (s) between switching function checks
-
getMaxIterationCount
public int getMaxIterationCount()
Get maximal number of iterations in the event time search.- Specified by:
getMaxIterationCount
in interfaceEventDetector
- Returns:
- maximal number of iterations in the event time search
-
getThreshold
public double getThreshold()
Get the convergence threshold in the event time search.- Specified by:
getThreshold
in interfaceEventDetector
- Returns:
- convergence threshold (s)
-
withMaxCheck
public T withMaxCheck(double newMaxCheck)
Setup the maximum checking interval.This will override a maximum checking interval if it has been configured previously.
- Parameters:
newMaxCheck
- maximum checking interval (s)- Returns:
- a new detector with updated configuration (the instance is not changed)
- Since:
- 6.1
-
withMaxCheck
public T withMaxCheck(AdaptableInterval newMaxCheck)
Setup the maximum checking interval.This will override a maximum checking interval if it has been configured previously.
- Parameters:
newMaxCheck
- maximum checking interval (s)- Returns:
- a new detector with updated configuration (the instance is not changed)
- Since:
- 12.0
-
withMaxIter
public T withMaxIter(int newMaxIter)
Setup the maximum number of iterations in the event time search.This will override a number of iterations if it has been configured previously.
- Parameters:
newMaxIter
- maximum number of iterations in the event time search- Returns:
- a new detector with updated configuration (the instance is not changed)
- Since:
- 6.1
-
withThreshold
public T withThreshold(double newThreshold)
Setup the convergence threshold.This will override a convergence threshold if it has been configured previously.
- Parameters:
newThreshold
- convergence threshold (s)- Returns:
- a new detector with updated configuration (the instance is not changed)
- Since:
- 6.1
-
withHandler
public T withHandler(EventHandler newHandler)
Setup the event handler to call at event occurrences.This will override a handler if it has been configured previously.
- Parameters:
newHandler
- event handler to call at event occurrences- Returns:
- a new detector with updated configuration (the instance is not changed)
- Since:
- 6.1
-
getHandler
public EventHandler getHandler()
Get the handler.- Specified by:
getHandler
in interfaceEventDetector
- Returns:
- event handler to call at event occurrences
-
create
protected abstract T create(AdaptableInterval newMaxCheck, double newThreshold, int newMaxIter, EventHandler newHandler)
Build a new instance.- Parameters:
newMaxCheck
- maximum checking interval (s)newThreshold
- convergence threshold (s)newMaxIter
- maximum number of iterations in the event time searchnewHandler
- event handler to call at event occurrences- Returns:
- a new instance of the appropriate sub-type
-
isForward
public boolean isForward()
Check if the current propagation is forward or backward.- Returns:
- true if the current propagation is forward
- Since:
- 7.2
-
-