Class EventMultipleHandler
java.lang.Object
org.orekit.propagation.events.handlers.EventMultipleHandler
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddHandler(EventHandler handler) Add one handler to the managed handlers list.final EventMultipleHandleraddHandlers(EventHandler... newHandlers) Add several handlers to the managed handlers list.eventOccurred(SpacecraftState s, EventDetector detector, boolean increasing) Handle an event.voidfinish(SpacecraftState finalState, EventDetector detector) This method finalizes the event handler's job.Retrieve managed handlers list.voidinit(SpacecraftState initialState, AbsoluteDate target, EventDetector detector) Initialize event handler at the start of a propagation.resetState(EventDetector detector, SpacecraftState oldState) Reset the state prior to continue propagation.voidsetHandlers(List<EventHandler> newHandlers) Change handlers list with user input.
-
Constructor Details
-
EventMultipleHandler
public EventMultipleHandler()Constructor with list initialisation.
-
-
Method Details
-
init
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:
initin interfaceEventHandler- Parameters:
initialState- initial statetarget- target date for the propagationdetector- event detector related to the event handler
-
eventOccurred
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 ofAbstractDetectorare successively called and Action from H1 can prevent H2 from happening if H1 returnedresetState. 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:
eventOccurredin interfaceEventHandler- Parameters:
s- SpaceCraft state to be used in the evaluationdetector- object with appropriate type that can be used in determining correct return stateincreasing- 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
Reset the state prior to continue propagation.All handlers that return
resetStatewhen callingeventOccurred(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:
resetStatein interfaceEventHandler- Parameters:
detector- object with appropriate type that can be used in determining correct return stateoldState- old state- Returns:
- new state
-
finish
Description copied from interface:EventHandlerThis method finalizes the event handler's job.The default implementation does nothing
- Specified by:
finishin interfaceEventHandler- Parameters:
finalState- state at propagation enddetector- event detector related to the event handler
-
addHandler
Add one handler to the managed handlers list.- Parameters:
handler- handler associated with D detector- Returns:
- this object
-
addHandlers
Add several handlers to the managed handlers list.- Parameters:
newHandlers- handlers associated with D detector- Returns:
- this object
-
setHandlers
Change handlers list with user input.- Parameters:
newHandlers- new handlers list associated with D detector
-
getHandlers
Retrieve managed handlers list.- Returns:
- list of handlers for event overrides
-