Class EventMultipleHandler

java.lang.Object
org.orekit.propagation.events.handlers.EventMultipleHandler
All Implemented Interfaces:
EventHandler

public class EventMultipleHandler extends Object implements EventHandler
Facade handlers that allows to use several handlers for one detector. Otherwise, the use of several detectors, each associated with one handler, that detect the same event can lead to non-deterministic behaviour. This handler manages several handlers. The action returned is based on a priority rule (see eventOccurred(org.orekit.propagation.SpacecraftState, org.orekit.propagation.events.EventDetector, boolean)) : stop > resetState > resetDerivatives > resetRevents > continue
Since:
10.3
Author:
Lara Hué
  • Constructor Details

    • EventMultipleHandler

      public EventMultipleHandler()
      Constructor with list initialisation.
  • Method Details

    • init

      public void init(SpacecraftState initialState, AbsoluteDate target, EventDetector 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

      All handlers' init methods are successively called, the order method is the order in which handlers are added

      Specified by:
      init in interface EventHandler
      Parameters:
      initialState - initial state
      target - target date for the propagation
      detector - event detector related to the event handler
    • eventOccurred

      public Action eventOccurred(SpacecraftState s, EventDetector detector, boolean increasing)
      Handle an event. The MultipleEventHandler class implies a different behaviour on event detections than with other handlers : Without the MultipleEventHandler, there is a total order on event occurrences. Handlers H1, H2, ... that are associated with different instances of AbstractDetector are successively called and Action from H1 can prevent H2 from happening if H1 returned resetState. With the MultipleEventHandler class, when event E occurs, all methods eventOccurred of Handlers H1, H2... from MultiEventHandler attributes are called, then Action is decided.
      Specified by:
      eventOccurred in interface EventHandler
      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 occurred in an "increasing" or "decreasing" slope direction
      Returns:
      the Action that the calling detector should pass back to the evaluation system
    • resetState

      public SpacecraftState resetState(EventDetector detector, SpacecraftState oldState)
      Reset the state prior to continue propagation.

      All handlers that return resetState when calling eventOccurred(org.orekit.propagation.SpacecraftState, org.orekit.propagation.events.EventDetector, boolean) are saved in resetStateHandlers. Their methods resetState are successively called. The order for calling resetState methods is the order in which handlers are added.

      Specified by:
      resetState in interface EventHandler
      Parameters:
      detector - object with appropriate type that can be used in determining correct return state
      oldState - old state
      Returns:
      new state
    • finish

      public void finish(SpacecraftState finalState, EventDetector detector)
      Description copied from interface: EventHandler
      This method finalizes the event handler's job.

      The default implementation does nothing

      Specified by:
      finish in interface EventHandler
      Parameters:
      finalState - state at propagation end
      detector - event detector related to the event handler
    • addHandler

      public EventMultipleHandler addHandler(EventHandler handler)
      Add one handler to the managed handlers list.
      Parameters:
      handler - handler associated with D detector
      Returns:
      this object
    • addHandlers

      @SafeVarargs public final EventMultipleHandler addHandlers(EventHandler... newHandlers)
      Add several handlers to the managed handlers list.
      Parameters:
      newHandlers - handlers associated with D detector
      Returns:
      this object
    • setHandlers

      public void setHandlers(List<EventHandler> newHandlers)
      Change handlers list with user input.
      Parameters:
      newHandlers - new handlers list associated with D detector
    • getHandlers

      public List<EventHandler> getHandlers()
      Retrieve managed handlers list.
      Returns:
      list of handlers for event overrides