public class OneSatEventDetectorWrapper extends MultiAbstractDetector
This class allows to convert an EventDetector into a MultiEventDetector. The EventDetector is
associated with a single spacecraft identified by its ID.
MultiPropagator.addEventDetector(EventDetector, String)DEFAULT_MAX_ITERATION_COUNT, DEFAULT_MAXCHECK, DEFAULT_THRESHOLDDECREASING, INCREASING, INCREASING_DECREASING| Constructor and Description |
|---|
OneSatEventDetectorWrapper(EventDetector detector,
String satId)
Simple constructor.
|
| Modifier and Type | Method and Description |
|---|---|
EventDetector.Action |
eventOccurred(Map<String,SpacecraftState> state,
boolean increasing,
boolean forward)
Handle an event and choose what to do next.
|
boolean |
filterEvent(Map<String,SpacecraftState> states,
boolean increasing,
boolean forward)
Filter last event: returns true if the last event is a false detection, false otherwise.
|
double |
g(Map<String,SpacecraftState> state)
Compute the value of the switching function.
|
double |
g(SpacecraftState state)
Compute the value of the switching function.
|
String |
getID()
Returns the ID of the spacecraft associated with the detector.
|
void |
init(Map<String,SpacecraftState> statesMap,
AbsoluteDate date)
Initialize event handler at the start of a propagation.
|
Map<String,SpacecraftState> |
resetStates(Map<String,SpacecraftState> oldStates)
Reset the states (including additional states) prior to continue propagation.
|
boolean |
shouldBeRemoved()
This method is called after the step handler has returned and before the next step is started, but only when
MultiEventDetector.eventOccurred(java.util.Map<java.lang.String, fr.cnes.sirius.patrius.propagation.SpacecraftState>, boolean, boolean) has been called. |
getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getThresholdpublic OneSatEventDetectorWrapper(EventDetector detector, String satId)
detector - the event detectorsatId - the ID of the spacecraft associated with the detectorpublic void init(Map<String,SpacecraftState> statesMap, AbsoluteDate date) throws PatriusException
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.
init in interface MultiEventDetectorinit in class MultiAbstractDetectorstatesMap - map of initial statesdate - target time for the integrationPatriusException - thrown if initialization failedpublic double g(SpacecraftState state) throws PatriusException
state - the current states information: date, kinematics, attitudes for forces
and events computation, and additional states for each statesPatriusException - if some specific error occurspublic double g(Map<String,SpacecraftState> state) throws PatriusException
This function must be continuous (at least in its roots neighborhood), as the integrator will need to find its roots to locate the events.
g in interface MultiEventDetectorg in class MultiAbstractDetectorstate - the current states information: date, kinematics, attitudes for forces
and events computation, and additional states for each statesPatriusException - if some specific error occurspublic EventDetector.Action eventOccurred(Map<String,SpacecraftState> state, boolean increasing, boolean forward) throws PatriusException
The scheduling between this method and the MultiOrekitStepHandler method handleStep is to call this method first
and handleStep afterwards. This scheduling allows the propagator to pass true as the
isLast parameter to the step handler to make it aware the step will be the last one if this method
returns EventDetector.Action.STOP. As the interpolator may be
used to navigate back throughout the last step MultiOrekitStepNormalizer does for example), user code called by
this method and user code called by step handlers may experience apparently out of order values of the
independent time variable. As an example, if the same user object implements both this MultiEventDetector interface and the MultiOrekitFixedStepHandler interface, a forward integration may
call its eventOccurred method with a state at 2000-01-01T00:00:10 first and call its
handleStep method with a state at 2000-01-01T00:00:09 afterwards. Such out of order calls are
limited to the size of the integration step for MultiOrekitStepHandler and to the size of the fixed step for
MultiOrekitFixedStepHandler.
eventOccurred in interface MultiEventDetectoreventOccurred in class MultiAbstractDetectorstate - the current states information: date, kinematics, attitude for forces
and events computation, and additional states for each statesincreasing - if true, the value of the switching function increases
when times increases around event (note that increase is measured with respect
to physical time, not with respect to propagation which may go backward in time)forward - if true, the integration variable (time) increases during integration.EventDetector.Action.STOP,
EventDetector.Action.RESET_STATE,
EventDetector.Action.RESET_DERIVATIVES,
EventDetector.Action.CONTINUEPatriusException - if some specific error occurspublic boolean shouldBeRemoved()
This method is called after the step handler has returned and before the next step is started, but only when
MultiEventDetector.eventOccurred(java.util.Map<java.lang.String, fr.cnes.sirius.patrius.propagation.SpacecraftState>, boolean, boolean) has been called.
shouldBeRemoved in interface MultiEventDetectorshouldBeRemoved in class MultiAbstractDetectorpublic Map<String,SpacecraftState> resetStates(Map<String,SpacecraftState> oldStates) throws PatriusException
This method is called after the step handler has returned and before the next step is started, but only when
MultiEventDetector.eventOccurred(java.util.Map<java.lang.String, fr.cnes.sirius.patrius.propagation.SpacecraftState>, boolean, boolean) has itself returned the
EventDetector.Action.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 the
MultiEventDetector.eventOccurred(java.util.Map<java.lang.String, fr.cnes.sirius.patrius.propagation.SpacecraftState>, boolean, boolean) never returns the
EventDetector.Action.RESET_STATE indicator, this function will
never be called, and it is safe to simply return null.
resetStates in interface MultiEventDetectorresetStates in class MultiAbstractDetectoroldStates - old statesPatriusException - if the states cannot be resetedpublic boolean filterEvent(Map<String,SpacecraftState> states, boolean increasing, boolean forward) throws PatriusException
This method is called right before MultiEventDetector.eventOccurred(Map, boolean, boolean) method.
This may be useful in order to filter some events in particular when angles are at stake (see for example
LocalTimeAngleDetector).
filterEvent in interface MultiEventDetectorfilterEvent in class MultiAbstractDetectorstates - states at last event occurrenceincreasing - if true, the value of the switching function increases when times increases
around event (note that increase is measured with respect to physical time, not with
respect to propagation which may go backward in time)forward - if true, the integration variable (time) increases during integration.PatriusException - thrown if computation failed for some reasonspublic String getID()
Copyright © 2025 CNES. All rights reserved.