Class EventState<T extends EventDetector>
- java.lang.Object
-
- org.orekit.propagation.events.EventState<T>
-
- Type Parameters:
T
- class type for the generic version
public class EventState<T extends EventDetector> extends Object
This class handles the state for oneevent detector
during integration steps.This class is heavily based on the class with the same name from the Hipparchus library. The changes performed consist in replacing raw types (double and double arrays) with space dynamics types (
AbsoluteDate
,SpacecraftState
).Each time the propagator proposes a step, the event detector should be checked. This class handles the state of one detector during one propagation step, with references to the state at the end of the preceding step. This information is used to determine if the detector should trigger an event or not during the proposed step (and hence the step should be reduced to ensure the event occurs at a bound rather than inside the step).
- Author:
- Luc Maisonobe
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EventState.EventOccurrence
Class to hold the data related to an event occurrence that is needed to decide how to modify integration.
-
Constructor Summary
Constructors Constructor Description EventState(T detector)
Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventState.EventOccurrence
doEvent(SpacecraftState state)
Notify the user's listener of the event.boolean
evaluateStep(OrekitStepInterpolator interpolator)
Evaluate the impact of the proposed step on the event detector.AbsoluteDate
getEventDate()
Get the occurrence time of the event triggered in the current step.T
getEventDetector()
Get the underlying event detector.void
init(SpacecraftState s0, AbsoluteDate t)
Initialize event handler at the start of a propagation.void
reinitializeBegin(OrekitStepInterpolator interpolator)
Reinitialize the beginning of the step.boolean
tryAdvance(SpacecraftState state, OrekitStepInterpolator interpolator)
Try to accept the current history up to the given time.
-
-
-
Constructor Detail
-
EventState
public EventState(T detector)
Simple constructor.- Parameters:
detector
- monitored event detector
-
-
Method Detail
-
getEventDetector
public T getEventDetector()
Get the underlying event detector.- Returns:
- underlying event 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.
- Parameters:
s0
- initial statet
- target time for the integration
-
reinitializeBegin
public void reinitializeBegin(OrekitStepInterpolator interpolator)
Reinitialize the beginning of the step.- Parameters:
interpolator
- interpolator valid for the current step
-
evaluateStep
public boolean evaluateStep(OrekitStepInterpolator interpolator) throws MathRuntimeException
Evaluate the impact of the proposed step on the event detector.- Parameters:
interpolator
- step interpolator for the proposed step- Returns:
- true if the event detector triggers an event before the end of the proposed step (this implies the step should be rejected)
- Throws:
MathRuntimeException
- if an event cannot be located
-
getEventDate
public AbsoluteDate getEventDate()
Get the occurrence time of the event triggered in the current step.- Returns:
- occurrence time of the event triggered in the current step.
-
tryAdvance
public boolean tryAdvance(SpacecraftState state, OrekitStepInterpolator interpolator)
Try to accept the current history up to the given time.It is not necessary to call this method before calling
doEvent(SpacecraftState)
with the same state. It is necessary to call this method before you calldoEvent(SpacecraftState)
on some other event detector.- Parameters:
state
- to try to accept.interpolator
- to use to find the new root, if any.- Returns:
- if the event detector has an event it has not detected before that is on or
before the same time as
state
. In other wordsfalse
means continue on whiletrue
means stop and handle my event first.
-
doEvent
public EventState.EventOccurrence doEvent(SpacecraftState state)
Notify the user's listener of the event. The event occurs wholly within this method call including a call toEventHandler.resetState(EventDetector, SpacecraftState)
if necessary.- Parameters:
state
- the state at the time of the event. This must be at the same time as the current value ofgetEventDate()
.- Returns:
- the user's requested action and the new state if the action is
Action.RESET_STATE
. Otherwise the new state isstate
. The stop time indicates what time propagation should stop if the action isAction.STOP
. This guarantees the integration will stop on or after the root, so that integration may be restarted safely.
-
-