Class PythonEventHandler<T extends EventDetector>

  • All Implemented Interfaces:
    EventHandler<T>

    public class PythonEventHandler<T extends EventDetector>
    extends Object
    implements EventHandler<T>
    This interface represents space-dynamics aware events detectors.

    It mirrors the EventHandler interface from Apache Commons Math but provides a space-dynamics interface to the methods.

    Events detectors are a useful solution to meet the requirements of propagators concerning discrete conditions. The state of each event detector is queried by the integrator at each step. When the sign of the underlying g switching function changes, the step is rejected and reduced, in order to make sure the sign changes occur only at steps boundaries.

    When step ends exactly at a switching function sign change, the corresponding event is triggered, by calling the #eventOccurred(SpacecraftState, boolean) method. The method can do whatever it needs with the event (logging it, performing some processing, ignore it ...). The return value of the method will be used by the propagator to stop or resume propagation, possibly changing the state vector.

    Author:
    Luc Maisonobe, Véronique Pommier-Maurussane
    • Constructor Detail

      • PythonEventHandler

        public PythonEventHandler()
    • Method Detail

      • pythonExtension

        public void pythonExtension​(long pythonObject)
        Part of JCC Python interface to object
      • pythonExtension

        public long pythonExtension()
        Part of JCC Python interface to object
      • pythonDecRef

        public void pythonDecRef()
        Part of JCC Python interface to object
      • getPythonObject

        public long getPythonObject()
      • init

        public void init​(SpacecraftState initialState,
                         AbsoluteDate target,
                         T detector)
        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 EventHandler<T extends EventDetector>
        Parameters:
        initialState - initial state
        target - target date for the propagation
        detector - event detector related to the event handler
      • eventOccurred

        public Action eventOccurred​(SpacecraftState s,
                                    T detector,
                                    boolean increasing)
        eventOccurred method mirrors the same interface method as in EventDetector and its subclasses, but with an additional parameter that allows the calling method to pass in an object from the detector which would have potential additional data to allow the implementing class to determine the correct return state.
        Specified by:
        eventOccurred in interface EventHandler<T extends EventDetector>
        Parameters:
        s - SpaceCraft state to be used in the evaluation
        detector - object with appropriate type that can be used in determining correct return state
        increasing - with the event occured in an "increasing" or "decreasing" slope direction
        Returns:
        the Action that the calling detector should pass back to the evaluation system
        Throws:
        OrekitException - if some specific error occurs