Class EventEnablingPredicateFilter
- java.lang.Object
-
- org.orekit.propagation.events.EventEnablingPredicateFilter
-
- All Implemented Interfaces:
DetectorModifier
,EventDetector
public class EventEnablingPredicateFilter extends Object implements DetectorModifier
Wrapper used to detect events only when enabled by an external predicated function.General
events
are defined implicitly by ag function
crossing zero. This implies that during an orbit propagation, events are triggered at all zero crossings.Sometimes, users would like to enable or disable events by themselves, for example to trigger them only for certain orbits, or to check elevation maximums only when elevation itself is positive (i.e. they want to discard elevation maximums below ground). In these cases, looking precisely for all events location and triggering events that will later be ignored is a waste of computing time.
Users can wrap a regular
event detector
in an instance of this class and provide this wrapping instance to aPropagator
in order to avoid wasting time looking for uninteresting events. The wrapper will intercept the calls to theg function
and to theeventOccurred
method in order to ignore uninteresting events. The wrapped regularevent detector
will the see only the interesting events, i.e. either only events that occur when a user-provided event enabling predicate function is true, ignoring all events that occur when the event enabling predicate function is false. The number of calls to theg function
will also be reduced.- Since:
- 7.1
- See Also:
EventSlopeFilter
-
-
Constructor Summary
Constructors Constructor Description EventEnablingPredicateFilter(EventDetectionSettings detectionSettings, EventDetector rawDetector, EnablingPredicate enabler)
Constructor with full parameters.EventEnablingPredicateFilter(EventDetector rawDetector, EnablingPredicate enabler)
Wrap anevent detector
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
g(SpacecraftState s)
Compute the value of the switching function.EventDetectionSettings
getDetectionSettings()
Getter for the settings.EventDetector
getDetector()
Get the wrapped raw detector.EventHandler
getHandler()
Get the handler.void
init(SpacecraftState s0, AbsoluteDate t)
Initialize event detector at the start of a propagation.boolean
isForward()
Check if the current propagation is forward or backward.void
reset(SpacecraftState state, AbsoluteDate target)
Reset the event detector during propagation when the state is modified by an event or an additional data provider.EventEnablingPredicateFilter
withDetectionSettings(EventDetectionSettings settings)
Builds a new instance from the input detection settings.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.orekit.propagation.events.DetectorModifier
finish
-
Methods inherited from interface org.orekit.propagation.events.EventDetector
getMaxCheckInterval, getMaxIterationCount, getThreshold
-
-
-
-
Constructor Detail
-
EventEnablingPredicateFilter
public EventEnablingPredicateFilter(EventDetector rawDetector, EnablingPredicate enabler)
Wrap anevent detector
.- Parameters:
rawDetector
- event detector to wrap (its detection settings are taken as well)enabler
- event enabling predicate function to use
-
EventEnablingPredicateFilter
public EventEnablingPredicateFilter(EventDetectionSettings detectionSettings, EventDetector rawDetector, EnablingPredicate enabler)
Constructor with full parameters.- Parameters:
detectionSettings
- event detection settingsrawDetector
- event detector to wrapenabler
- event enabling function to use- Since:
- 13.0
-
-
Method Detail
-
withDetectionSettings
public EventEnablingPredicateFilter withDetectionSettings(EventDetectionSettings settings)
Builds a new instance from the input detection settings.- Parameters:
settings
- event detection settings to be used- Returns:
- a new detector
-
getDetector
public EventDetector getDetector()
Get the wrapped raw detector.- Specified by:
getDetector
in interfaceDetectorModifier
- Returns:
- the wrapped raw detector
- Since:
- 11.1
-
getHandler
public EventHandler getHandler()
Get the handler.- Specified by:
getHandler
in interfaceDetectorModifier
- Specified by:
getHandler
in interfaceEventDetector
- Returns:
- event handler to call at event occurrences
-
getDetectionSettings
public EventDetectionSettings getDetectionSettings()
Getter for the settings.- Specified by:
getDetectionSettings
in interfaceDetectorModifier
- Specified by:
getDetectionSettings
in interfaceEventDetector
- Returns:
- detection settings
-
init
public void init(SpacecraftState s0, AbsoluteDate t)
Initialize event detector 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 initializes the handler.
- Specified by:
init
in interfaceDetectorModifier
- Specified by:
init
in interfaceEventDetector
- Parameters:
s0
- initial statet
- target time for the integration
-
reset
public void reset(SpacecraftState state, AbsoluteDate target)
Reset the event detector during propagation when the state is modified by an event or an additional data provider.The default implementation does nothing.
- Specified by:
reset
in interfaceDetectorModifier
- Specified by:
reset
in interfaceEventDetector
- Parameters:
state
- current statetarget
- target time for the integration
-
g
public double g(SpacecraftState s)
Compute the value of the switching function. This function must be continuous (at least in its roots neighborhood), as the integrator will need to find its roots to locate the events.- Specified by:
g
in interfaceDetectorModifier
- Specified by:
g
in interfaceEventDetector
- Parameters:
s
- the current state information: date, kinematics, attitude- Returns:
- value of the switching function
-
isForward
public boolean isForward()
Check if the current propagation is forward or backward.- Returns:
- true if the current propagation is forward
-
-