D
- object type of the detector which is linked to the handlerpublic class EventMultipleHandler<D extends EventDetector> extends Object implements EventHandler<D>
eventOccurred(org.orekit.propagation.SpacecraftState, D, boolean)
) :
stop
> resetState
> resetDerivatives
> resetRevents
> continue
Constructor and Description |
---|
EventMultipleHandler()
Constructor with list initialisation.
|
Modifier and Type | Method and Description |
---|---|
EventMultipleHandler<D> |
addHandler(EventHandler<D> handler)
Add one handler to the managed handlers list.
|
EventMultipleHandler<D> |
addHandlers(EventHandler<D>... newHandlers)
Add several handlers to the managed handlers list.
|
Action |
eventOccurred(SpacecraftState s,
D 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. |
List<EventHandler<D>> |
getHandlers()
Retrieve managed handlers list.
|
void |
init(SpacecraftState initialState,
AbsoluteDate target,
D detector)
Initialize event handler at the start of a propagation.
|
SpacecraftState |
resetState(D detector,
SpacecraftState oldState)
Reset the state prior to continue propagation.
|
void |
setHandlers(List<EventHandler<D>> newHandlers)
Change handlers list with user input.
|
public EventMultipleHandler()
public void init(SpacecraftState initialState, AbsoluteDate target, D detector)
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
init
in interface EventHandler<D extends EventDetector>
initialState
- initial statetarget
- target date for the propagationdetector
- event detector related to the event handlerpublic Action eventOccurred(SpacecraftState s, D detector, boolean increasing)
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.
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.eventOccurred
in interface EventHandler<D extends EventDetector>
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 directionpublic SpacecraftState resetState(D detector, SpacecraftState oldState)
All handlers that return resetState
when calling eventOccurred(org.orekit.propagation.SpacecraftState, D, 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.
resetState
in interface EventHandler<D extends EventDetector>
detector
- object with appropriate type that can be used in determining correct return stateoldState
- old statepublic EventMultipleHandler<D> addHandler(EventHandler<D> handler)
handler
- handler associated with D detector@SafeVarargs public final EventMultipleHandler<D> addHandlers(EventHandler<D>... newHandlers)
newHandlers
- handlers associated with D detectorpublic void setHandlers(List<EventHandler<D>> newHandlers)
newHandlers
- new handlers list associated with D detectorpublic List<EventHandler<D>> getHandlers()
Copyright © 2002-2022 CS GROUP. All rights reserved.