Class AdapterDetector

  • All Implemented Interfaces:
    Serializable, EventDetector

    public class AdapterDetector
    extends Object
    implements EventDetector
    Base class for adapting an existing detector.

    This class is intended to be a base class for changing behaviour of a wrapped existing detector. This base class delegates all its methods to the wrapped detector. Classes extending it can therefore override only the methods they want to change.

    Since:
    9.3
    Author:
    Luc Maisonobe
    See Also:
    Serialized Form
    • Constructor Detail

      • AdapterDetector

        public AdapterDetector​(EventDetector detector)
        Build an adaptor wrapping an existing detector.
        Parameters:
        detector - detector to wrap
    • Method Detail

      • getDetector

        public EventDetector getDetector()
        Get the wrapped detector.
        Returns:
        wrapped detector
      • 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

        Specified by:
        init in interface EventDetector
        Parameters:
        s0 - initial state
        t - target time for the integration
      • g

        public 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 interface EventDetector
        Parameters:
        s - the current state information: date, kinematics, attitude
        Returns:
        value of the switching function
      • getThreshold

        public double getThreshold()
        Get the convergence threshold in the event time search.
        Specified by:
        getThreshold in interface EventDetector
        Returns:
        convergence threshold (s)
      • getMaxCheckInterval

        public double getMaxCheckInterval()
        Get maximal time interval between switching function checks.
        Specified by:
        getMaxCheckInterval in interface EventDetector
        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 interface EventDetector
        Returns:
        maximal number of iterations in the event time search
      • eventOccurred

        public EventHandler.Action eventOccurred​(SpacecraftState s,
                                                 boolean increasing)
        Handle the event.
        Specified by:
        eventOccurred in interface EventDetector
        Parameters:
        s - SpaceCraft state to be used in the evaluation
        increasing - with the event occurred in an "increasing" or "decreasing" slope direction
        Returns:
        the Action that the calling detector should pass back to the evaluation system