fr.cnes.sirius.patrius.events
Class CombinedPhenomenaDetector

java.lang.Object
  extended by org.orekit.propagation.events.AbstractDetector
      extended by fr.cnes.sirius.patrius.events.CombinedPhenomenaDetector
All Implemented Interfaces:
Serializable, EventDetector

public class CombinedPhenomenaDetector
extends AbstractDetector

This class finds the events resulting from the combination of two phenomena. Combinations of phenomena can be done using the following boolean operators:

The default implementation behaviour is to continue propagation when combined phnomena are detected. This can be changed by using one of the provided constructors.

Since:
1.1
Version:
$Id: CombinedPhenomenaDetector.java 17586 2017-05-10 13:29:16Z bignon $
Author:
Julie Anton, Tiziana Sabatini
See Also:
EventDetector, Propagator.addEventDetector(EventDetector), Serialized Form
Concurrency :
not thread-safe or thread-hostile
Concurrency comment :
As of now, existing Orekit EventDetector implementations are either not thread-safe or thread-hostile, so this class also is. But this class could probably become conditionally thread-safe; the main thread safety condition would then be that the included EventDetector should be thread-safe.

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.orekit.propagation.events.EventDetector
EventDetector.Action
 
Field Summary
 
Fields inherited from class org.orekit.propagation.events.AbstractDetector
DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
 
Fields inherited from interface org.orekit.propagation.events.EventDetector
DECREASING, INCREASING, INCREASING_DECREASING
 
Constructor Summary
CombinedPhenomenaDetector(EventDetector d1, boolean d1IncreasingIsStart, EventDetector d2, boolean d2IncreasingIsStart, boolean togetherIn)
          Constructor for the detector of the combination of two phenomena.
CombinedPhenomenaDetector(EventDetector d1, boolean d1IncreasingIsStart, EventDetector d2, boolean d2IncreasingIsStart, boolean togetherIn, EventDetector.Action action)
          Constructor for the detector of the combination of two phenomena.
 
Method Summary
 EventDetector.Action eventOccurred(SpacecraftState s, boolean increasing, boolean forward)
          Handle an event and choose what to do next.
 double g(SpacecraftState s)
          Compute the value of the switching function for a combination (AND or OR) of two phenomena.
After computing the switching function of each detector and, if necessary, changing its sign to apply a general convention (g>0 if the phenomenon associated to an event is active), it returns one between the two g functions, according to the boolean operator.
 EventDetector getDetector1()
          Returns first detector.
 EventDetector getDetector2()
          Returns second detector.
 void init(SpacecraftState s0, AbsoluteDate t)
          Initialize event handler at the start of a propagation.
 boolean shouldBeRemoved()
          This method is called after EventDetector.eventOccurred(org.orekit.propagation.SpacecraftState, boolean, boolean) has been triggered.
 
Methods inherited from class org.orekit.propagation.events.AbstractDetector
getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getThreshold, resetState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CombinedPhenomenaDetector

public CombinedPhenomenaDetector(EventDetector d1,
                                 boolean d1IncreasingIsStart,
                                 EventDetector d2,
                                 boolean d2IncreasingIsStart,
                                 boolean togetherIn)
Constructor for the detector of the combination of two phenomena.

Parameters:
d1 - the first EventDetector
d1IncreasingIsStart - true if increasing of the g function of the the first EventDetector represents the "beginning" of the associated phenomenon
d2 - the second EventDetector
d2IncreasingIsStart - true if increasing of the g function of the the second EventDetector represents the "beginning" of the associated phenomenon
togetherIn - true if AND, false if OR

CombinedPhenomenaDetector

public CombinedPhenomenaDetector(EventDetector d1,
                                 boolean d1IncreasingIsStart,
                                 EventDetector d2,
                                 boolean d2IncreasingIsStart,
                                 boolean togetherIn,
                                 EventDetector.Action action)
Constructor for the detector of the combination of two phenomena.

Parameters:
d1 - the first EventDetector
d1IncreasingIsStart - true if increasing of the g function of the the first EventDetector represents the "beginning" of the associated phenomenon
d2 - the second EventDetector
d2IncreasingIsStart - true if increasing of the g function of the the second EventDetector represents the "beginning" of the associated phenomenon
togetherIn - true if AND, false if OR
action - action performed at combined Phenomena detection
Method Detail

g

public final double g(SpacecraftState s)
               throws OrekitException
Compute the value of the switching function for a combination (AND or OR) of two phenomena.
After computing the switching function of each detector and, if necessary, changing its sign to apply a general convention (g>0 if the phenomenon associated to an event is active), it returns one between the two g functions, according to the boolean operator.

Specified by:
g in interface EventDetector
Specified by:
g in class AbstractDetector
Parameters:
s - the SpacecraftState that contains the current state information
Returns:
value of the switching function
Throws:
OrekitException - if some specific error occurs

eventOccurred

public EventDetector.Action eventOccurred(SpacecraftState s,
                                          boolean increasing,
                                          boolean forward)
                                   throws OrekitException
Handle an event and choose what to do next.

Specified by:
eventOccurred in interface EventDetector
Specified by:
eventOccurred in class AbstractDetector
Parameters:
s - the SpacecraftState that contains the current state information
increasing - if true, the value of the switching function increases when times increases around event
forward - if true, the integration variable (time) increases during integration.
Returns:
the action performed when the expected combined philomena is reached
Throws:
OrekitException - if some specific error occurs

shouldBeRemoved

public boolean shouldBeRemoved()
Description copied from class: AbstractDetector
This method is called after EventDetector.eventOccurred(org.orekit.propagation.SpacecraftState, boolean, boolean) has been triggered. It returns true if the current detector should be removed after first event detection. WARNING: this method can be called only once a event has been triggered. Before, the value is not available.

Specified by:
shouldBeRemoved in interface EventDetector
Specified by:
shouldBeRemoved in class AbstractDetector
Returns:
true if the current detector should be removed after first event detection

init

public void init(SpacecraftState s0,
                 AbsoluteDate t)
Description copied from class: AbstractDetector
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.

Specified by:
init in interface EventDetector
Overrides:
init in class AbstractDetector
Parameters:
s0 - initial state
t - target time for the integration

getDetector1

public EventDetector getDetector1()
Returns first detector.

Returns:
EventDetector 1

getDetector2

public EventDetector getDetector2()
Returns second detector.

Returns:
EventDetector 2


Copyright © 2017 CNES. All Rights Reserved.