|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.cnes.sirius.patrius.events.multi.MultiGenericCodingEventDetector
public class MultiGenericCodingEventDetector
This class is copied from GenericCodingEventDetector
and adapted to multi
propagation.
This class represents an all-purpose implementation of the MultiCodingEventDetector
interface.
It works using the MultiEventDetector
provided in the constructor.
CodedEvent
for a given date
using the method buildCodedEvent
.
It supports phenomena or not, depending on which constructor was used. When it does support phenomena, the user can
know for a given input if the state is active using the method isStateActive
.
MultiCodingEventDetector
Field Summary |
---|
Fields inherited from interface org.orekit.propagation.events.multi.MultiEventDetector |
---|
DECREASING, INCREASING, INCREASING_DECREASING |
Constructor Summary | |
---|---|
MultiGenericCodingEventDetector(MultiEventDetector multiEventDetectorIn,
String increasingCodeIn,
String decreasingCodeIn)
Constructor for a MultiGenericCodingEventDetector that does not
support a Phenomenon . |
|
MultiGenericCodingEventDetector(MultiEventDetector multiEventDetectorIn,
String increasingCodeIn,
String decreasingCodeIn,
boolean increasingIsStartIn,
String phenomenonCodeIn)
Constructor for a MultiGenericCodingEventDetector that supports a Phenomenon .No delays and no occurrence numbers are associated to the events detected by this detector. |
|
MultiGenericCodingEventDetector(MultiEventDetector multiEventDetectorIn,
String increasingCodeIn,
String decreasingCodeIn,
boolean increasingIsStartIn,
String phenomenonCodeIn,
double delayIn,
int occurrenceIn)
Constructor for a MultiGenericCodingEventDetector that supports a Phenomenon .A delay and/or an occurrence number can be associated to the events detected by this detector. When a delay is added to the detected events, two kinds of events will be coded: - the original events, with their original codes; - the delayed events, whose codes will be "DELAYED_" followed by the original code. |
|
MultiGenericCodingEventDetector(MultiEventDetector multiEventDetectorIn,
String increasingCodeIn,
String decreasingCodeIn,
double delayIn,
int occurrenceIn)
Constructor for a MultiGenericCodingEventDetector that does not
support a Phenomenon .When a delay is added to the detected events, two kinds of events will be coded: - the original events, with their original codes; - the delayed events, whose codes will be "DELAYED_" followed by the original code. |
Method Summary | |
---|---|
CodedEvent |
buildCodedEvent(Map<String,SpacecraftState> states,
boolean increasing)
Build a CodedEvent instance appropriate for the provided map of SpacecraftState . |
CodedEvent |
buildDelayedCodedEvent(Map<String,SpacecraftState> states,
boolean increasing)
Build a delayed CodedEvent instance appropriate for the provided map of SpacecraftState . |
CodedEvent |
buildOccurrenceCodedEvent(Map<String,SpacecraftState> states,
boolean increasing)
Build a CodedEvent instance appropriate for the provided map of SpacecraftState . |
EventDetector.Action |
eventOccurred(Map<String,SpacecraftState> s,
boolean increasing,
boolean forward)
Handle an event and choose what to do next. |
double |
g(Map<String,SpacecraftState> s)
Compute the value of the switching function. |
String |
getEventType()
Gets a code indicating the type of event we want to log: DELAY when a delay is associated to the logged events with respect to the detected events, N_OCCURRENCE when we want to log the nth occurrence of the detected events, STANDARD when no delays and no occurrence numbers are taken into consideration. |
double |
getMaxCheckInterval()
Get maximal time interval between switching function checks. |
int |
getMaxIterationCount()
Get maximal number of iterations in the event time search. |
String |
getPhenomenonCode()
If the implementation supports a Phenomenon , provides a code for
the phenomenon associated to the event. |
int |
getSlopeSelection()
Get the parameter in charge of the selection of detected events by the slope of the g-function. |
double |
getThreshold()
Get the convergence threshold in the event time search. |
void |
init(Map<String,SpacecraftState> s0,
AbsoluteDate t)
Initialize event handler at the start of a propagation. |
boolean |
isStateActive(Map<String,SpacecraftState> states)
Tells if the multi event state is "active" for the given input. |
boolean |
positiveSignMeansActive()
Get the sign of the g method that means "the phenomenon associated to the event is active". This method has been implemented because of the inconsistency of the sign of the g functions in the MultiEventDetector classes in Patrius:
for some events, g is positive when its associated phenomenon is active,
and for others, g is positive when its phenomenon is not active.WARNING : If Phenomena are not supported, the behavior of this method is undefined. |
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 has been called. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiGenericCodingEventDetector(MultiEventDetector multiEventDetectorIn, String increasingCodeIn, String decreasingCodeIn, boolean increasingIsStartIn, String phenomenonCodeIn)
MultiGenericCodingEventDetector
that supports a Phenomenon
.
multiEventDetectorIn
- the MultiEventDetector
of the current eventincreasingCodeIn
- code identifying the "increasing" eventdecreasingCodeIn
- code identifying the "decreasing" eventincreasingIsStartIn
- true if increasing of the g function represents the
"beginning" of the associated phenomenonphenomenonCodeIn
- code identifying the phenomenon associated to the eventMultiCodingEventDetector
,
MultiEventDetector
,
Phenomenon
public MultiGenericCodingEventDetector(MultiEventDetector multiEventDetectorIn, String increasingCodeIn, String decreasingCodeIn, boolean increasingIsStartIn, String phenomenonCodeIn, double delayIn, int occurrenceIn)
MultiGenericCodingEventDetector
that supports a Phenomenon
.
multiEventDetectorIn
- the MultiEventDetector
of the current eventincreasingCodeIn
- code identifying the "increasing" eventdecreasingCodeIn
- code identifying the "decreasing" eventincreasingIsStartIn
- true if increasing of the g function represents the
"beginning" of the associated phenomenonphenomenonCodeIn
- code identifying the phenomenon associated to the eventdelayIn
- the delay of the output events with respect to the events detected during propagation;
if it is set to zero, no delay will be added to the eventsoccurrenceIn
- the occurrence number of the output event (only the nth event will be detected);
if it is set to zero, all events will be detectedMultiCodingEventDetector
,
MultiEventDetector
,
Phenomenon
public MultiGenericCodingEventDetector(MultiEventDetector multiEventDetectorIn, String increasingCodeIn, String decreasingCodeIn)
MultiGenericCodingEventDetector
that does not
support a Phenomenon
.
No delays and no occurrence numbers are associated to the events detected by this detector.
multiEventDetectorIn
- the MultiEventDetector
of the current eventincreasingCodeIn
- code identifying the "increasing" eventdecreasingCodeIn
- code identifying the "decreasing" eventMultiCodingEventDetector
,
MultiEventDetector
public MultiGenericCodingEventDetector(MultiEventDetector multiEventDetectorIn, String increasingCodeIn, String decreasingCodeIn, double delayIn, int occurrenceIn)
MultiGenericCodingEventDetector
that does not
support a Phenomenon
.
multiEventDetectorIn
- the MultiEventDetector
of the current eventincreasingCodeIn
- code identifying the "increasing" eventdecreasingCodeIn
- code identifying the "decreasing" eventdelayIn
- the delay of the output events with respect to the events detected during propagation;
if it is set to zero, no delay will be added to the eventsoccurrenceIn
- the occurrence number of the output event (only the nth event will be detected);
if it is set to zero, all events will be detectedMultiCodingEventDetector
,
MultiEventDetector
Method Detail |
---|
public void init(Map<String,SpacecraftState> s0, AbsoluteDate t)
MultiEventDetector
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 MultiEventDetector
s0
- map of initial statest
- target time for the integrationpublic double g(Map<String,SpacecraftState> s) throws OrekitException
MultiEventDetector
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 MultiEventDetector
s
- the current states information: date, kinematics, attitudes for forces
and events computation, and additional states for each states
OrekitException
- if some specific error occurspublic EventDetector.Action eventOccurred(Map<String,SpacecraftState> s, boolean increasing, boolean forward) throws OrekitException
MultiEventDetector
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 MultiEventDetector
s
- 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.CONTINUE
OrekitException
- if some specific error occurspublic boolean shouldBeRemoved()
MultiEventDetector
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
has been called.
shouldBeRemoved
in interface MultiEventDetector
public Map<String,SpacecraftState> resetStates(Map<String,SpacecraftState> oldStates) throws OrekitException
MultiEventDetector
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
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
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 MultiEventDetector
oldStates
- old states
OrekitException
- if the states cannot be resetedpublic double getThreshold()
MultiEventDetector
getThreshold
in interface MultiEventDetector
public double getMaxCheckInterval()
MultiEventDetector
getMaxCheckInterval
in interface MultiEventDetector
public int getMaxIterationCount()
MultiEventDetector
getMaxIterationCount
in interface MultiEventDetector
public int getSlopeSelection()
MultiEventDetector
getSlopeSelection
in interface MultiEventDetector
public CodedEvent buildCodedEvent(Map<String,SpacecraftState> states, boolean increasing)
MultiCodingEventDetector
CodedEvent
instance appropriate for the provided map of SpacecraftState
.
buildCodedEvent
in interface MultiCodingEventDetector
states
- the current states informationincreasing
- if true, g function increases around event date.
CodedEvent
public CodedEvent buildDelayedCodedEvent(Map<String,SpacecraftState> states, boolean increasing)
MultiCodingEventDetector
CodedEvent
instance appropriate for the provided map of SpacecraftState
.
This instance will have a delay with respect to the associated detected event.
buildDelayedCodedEvent
in interface MultiCodingEventDetector
states
- the current states informationincreasing
- if true, g function increases around event date.
CodedEvent
public CodedEvent buildOccurrenceCodedEvent(Map<String,SpacecraftState> states, boolean increasing)
MultiCodingEventDetector
CodedEvent
instance appropriate for the provided map of SpacecraftState
.
This method will return an instance only if it is be the nth occurrence of the corresponding event,
otherwise it will return null. A delay can be applied to the event.
buildOccurrenceCodedEvent
in interface MultiCodingEventDetector
states
- the current states informationincreasing
- if true, g function increases around event date.
CodedEvent
public boolean positiveSignMeansActive()
MultiCodingEventDetector
MultiEventDetector
classes in Patrius:
for some events, g is positive when its associated phenomenon is active,
and for others, g is positive when its phenomenon is not active.
positiveSignMeansActive
in interface MultiCodingEventDetector
public String getPhenomenonCode()
MultiCodingEventDetector
Phenomenon
, provides a code for
the phenomenon associated to the event. If not, returns null.
getPhenomenonCode
in interface MultiCodingEventDetector
public final boolean isStateActive(Map<String,SpacecraftState> states) throws OrekitException
states
- the input map of SpacecraftState
OrekitException
- from the wrapped event detector.public String getEventType()
MultiCodingEventDetector
getEventType
in interface MultiCodingEventDetector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |