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:
AbstractGeographicalDetector, AbstractTopocentricDetector, AlignmentDetector, AngularSeparationDetector, AngularSeparationFromSatelliteDetector, ApsideDetector, BetaAngleDetector, BooleanDetector, CylindricalShadowEclipseDetector, DateDetector, EclipseDetector, ExtremumAngularSeparationDetector, ExtremumApproachDetector, FieldOfViewDetector, FootprintOverlapDetector, FunctionalDetector, GeographicZoneDetector, GroundFieldOfViewDetector, InterSatDirectViewDetector, MagneticFieldDetector, NegateDetector, NodeDetector, ParameterDrivenDateIntervalDetector, PlaneCrossingDetector, PositionAngleDetector, RelativeDistanceDetector, SingleDateDetector, TimeIntervalDetector

public abstract class AbstractDetector<T extends AbstractDetector<T>> extends Object implements EventDetector
Common parts shared by several events finders. It should only be implemented by detectors able to accept any handler.
Author:
Luc Maisonobe
See Also:
  • Field Details

    • DEFAULT_MAX_CHECK

      public static final double DEFAULT_MAX_CHECK
      Default maximum checking interval (s).
      See Also:
    • DEFAULT_THRESHOLD

      public static final double DEFAULT_THRESHOLD
      Default convergence threshold (s).
      See Also:
    • DEFAULT_MAX_ITER

      public static final int DEFAULT_MAX_ITER
      Default maximum number of iterations in the event time search.
      See Also:
  • Constructor Details

    • 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 search
      handler - event handler to call at event occurrences
    • AbstractDetector

      protected AbstractDetector(EventDetectionSettings detectionSettings, EventHandler handler)
      Build a new instance.
      Parameters:
      detectionSettings - event detection settings
      handler - event handler to call at event occurrences
      Since:
      12.2
    • AbstractDetector

      protected AbstractDetector(EventFunction eventFunction, EventDetectionSettings detectionSettings, EventHandler handler)
      Build a new instance.
      Parameters:
      eventFunction - event function
      detectionSettings - event detection settings
      handler - event handler to call at event occurrences
      Since:
      14.0
  • Method Details

    • checkIfForward

      public static boolean checkIfForward(SpacecraftState state, AbsoluteDate targetDate)
      Check if propagation is forward or not.
      Parameters:
      state - initial state
      targetDate - target propagation date
      Returns:
      forward flag
      Since:
      13.0
    • init

      public void init(SpacecraftState s0, AbsoluteDate t)
      Initialize event detector 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 initializes the handler.

      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 interface EventDetector
      Parameters:
      s0 - initial state
      t - target time for the integration
    • getEventFunction

      public EventFunction getEventFunction()
      Description copied from interface: EventDetector
      Get the event function. It defines g both for double and Field.
      Specified by:
      getEventFunction in interface EventDetector
      Returns:
      event function
    • getDetectionSettings

      public EventDetectionSettings getDetectionSettings()
      Getter for the settings.
      Specified by:
      getDetectionSettings in interface EventDetector
      Returns:
      detection settings
    • withMaxCheck

      public T withMaxCheck(double newMaxCheck)
      Set up 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)
      Set up 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)
      Set up 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)
      Set up 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
    • withDetectionSettings

      public T withDetectionSettings(EventDetectionSettings newSettings)
      Set up the event detection settings.

      This will override settings previously configured.

      Parameters:
      newSettings - new event detection settings
      Returns:
      a new detector with updated configuration (the instance is not changed)
      Since:
      12.2
    • withHandler

      public T withHandler(EventHandler newHandler)
      Set up 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 interface EventDetector
      Returns:
      event handler to call at event occurrences
    • create

      protected abstract T create(EventDetectionSettings detectionSettings, EventHandler newHandler)
      Build a new instance.
      Parameters:
      detectionSettings - detection settings
      newHandler - event handler to call at event occurrences
      Returns:
      a new instance of the appropriate sub-type
      Since:
      12.2
    • isForward

      public boolean isForward()
      Check if the current propagation is forward or backward.
      Returns:
      true if the current propagation is forward
      Since:
      7.2