Class FieldRecallLastOccurrence<T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.orekit.propagation.events.handlers.FieldRecallLastOccurrence<T>
-
- Type Parameters:
T
- field type
- All Implemented Interfaces:
FieldEventHandler<T>
public class FieldRecallLastOccurrence<T extends CalculusFieldElement<T>> extends Object implements FieldEventHandler<T>
Event handler wrapping another, arbitrary one whilst remembering date of last detection. If never used, the cache is null. If used but nothing detected, it returns past infinity in case of forward propagation and future infinity otherwise.- Since:
- 12.1
- Author:
- Romain Serra
- See Also:
RecallLastOccurrence
-
-
Constructor Summary
Constructors Constructor Description FieldRecallLastOccurrence(FieldEventHandler<T> wrappedHandler)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Action
eventOccurred(FieldSpacecraftState<T> s, FieldEventDetector<T> detector, boolean increasing)
Handle an event.FieldAbsoluteDate<T>
getLastOccurrence()
Getter for last occurrence.void
init(FieldSpacecraftState<T> initialState, FieldAbsoluteDate<T> target, FieldEventDetector<T> detector)
Initialize event handler at the start of a propagation.FieldSpacecraftState<T>
resetState(FieldEventDetector<T> detector, FieldSpacecraftState<T> oldState)
Reset the state prior to continue propagation.
-
-
-
Constructor Detail
-
FieldRecallLastOccurrence
public FieldRecallLastOccurrence(FieldEventHandler<T> wrappedHandler)
Constructor.- Parameters:
wrappedHandler
- event handler to wrap
-
-
Method Detail
-
getLastOccurrence
public FieldAbsoluteDate<T> getLastOccurrence()
Getter for last occurrence.- Returns:
- last date when underlying event was detected
-
init
public void init(FieldSpacecraftState<T> initialState, FieldAbsoluteDate<T> target, FieldEventDetector<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 interfaceFieldEventHandler<T extends CalculusFieldElement<T>>
- Parameters:
initialState
- initial statetarget
- target date for the propagationdetector
- event detector related to the event handler
-
eventOccurred
public Action eventOccurred(FieldSpacecraftState<T> s, FieldEventDetector<T> detector, boolean increasing)
Handle an event.- Specified by:
eventOccurred
in interfaceFieldEventHandler<T extends CalculusFieldElement<T>>
- 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
public FieldSpacecraftState<T> resetState(FieldEventDetector<T> detector, FieldSpacecraftState<T> oldState)
Reset the state prior to continue propagation.This method is called after the step handler has returned and before the next step is started, but only when
FieldEventHandler.eventOccurred(org.orekit.propagation.FieldSpacecraftState<T>, org.orekit.propagation.events.FieldEventDetector<T>, boolean)
has itself returned theAction.RESET_STATE
indicator. It allows the user to reset the state for the next step, without perturbing the step handler of the finishing step. If theFieldEventHandler.eventOccurred(org.orekit.propagation.FieldSpacecraftState<T>, org.orekit.propagation.events.FieldEventDetector<T>, boolean)
never returns theAction.RESET_STATE
indicator, this function will never be called, and it is safe to simply return null.The default implementation simply return its argument.
- Specified by:
resetState
in interfaceFieldEventHandler<T extends CalculusFieldElement<T>>
- Parameters:
detector
- object with appropriate type that can be used in determining correct return stateoldState
- old state- Returns:
- new state
-
-