Class FieldEventEnablingPredicateFilter<T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.orekit.propagation.events.FieldEventEnablingPredicateFilter<T>
-
- Type Parameters:
T- type of the field elements
- All Implemented Interfaces:
FieldDetectorModifier<T>,FieldEventDetector<T>
public class FieldEventEnablingPredicateFilter<T extends CalculusFieldElement<T>> extends Object implements FieldDetectorModifier<T>
Wrapper used to detect events only when enabled by an external predicated function.General
eventsare defined implicitly by ag functioncrossing 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 detectorin an instance of this class and provide this wrapping instance to aFieldPropagatorin order to avoid wasting time looking for uninteresting events. The wrapper will intercept the calls to theg functionand to theeventOccurredmethod in order to ignore uninteresting events. The wrapped regularevent detectorwill 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 functionwill also be reduced.- Since:
- 12.0
- See Also:
FieldEventSlopeFilter
-
-
Constructor Summary
Constructors Constructor Description FieldEventEnablingPredicateFilter(FieldEventDetectionSettings<T> detectionSettings, FieldEventDetector<T> rawDetector, FieldEnablingPredicate<T> enabler)Constructor with full parameters.FieldEventEnablingPredicateFilter(FieldEventDetector<T> rawDetector, FieldEnablingPredicate<T> enabler)Wrap anevent detector.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandependsOnTimeOnly()Method returning true if and only if the detection function g does not depend on dependent variables, just the independent one i.e. time.Tg(FieldSpacecraftState<T> s)Compute the value of the switching function.FieldEventDetectionSettings<T>getDetectionSettings()Getter for the settings.FieldEventDetector<T>getDetector()Get the wrapped raw detector.FieldEventHandler<T>getHandler()Get the handler.FieldEnablingPredicate<T>getPredicate()Getter for the enabling predicate.voidinit(FieldSpacecraftState<T> s0, FieldAbsoluteDate<T> t)Initialize event detector at the start of a propagation.booleanisForward()Check if the current propagation is forward or backward.voidreset(FieldSpacecraftState<T> state, FieldAbsoluteDate<T> target)Reset the event detector during propagation when the state is modified by an event or an additional data provider.FieldEventEnablingPredicateFilter<T>withDetectionSettings(FieldEventDetectionSettings<T> 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.FieldDetectorModifier
finish
-
Methods inherited from interface org.orekit.propagation.events.FieldEventDetector
getMaxCheckInterval, getMaxIterationCount, getThreshold
-
-
-
-
Constructor Detail
-
FieldEventEnablingPredicateFilter
public FieldEventEnablingPredicateFilter(FieldEventDetector<T> rawDetector, FieldEnablingPredicate<T> enabler)
Wrap anevent detector.- Parameters:
rawDetector- event detector to wrapenabler- event enabling predicate function to use
-
FieldEventEnablingPredicateFilter
public FieldEventEnablingPredicateFilter(FieldEventDetectionSettings<T> detectionSettings, FieldEventDetector<T> rawDetector, FieldEnablingPredicate<T> 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 FieldEventEnablingPredicateFilter<T> withDetectionSettings(FieldEventDetectionSettings<T> settings)
Builds a new instance from the input detection settings.- Parameters:
settings- event detection settings to be used- Returns:
- a new detector
-
getDetector
public FieldEventDetector<T> getDetector()
Get the wrapped raw detector.- Specified by:
getDetectorin interfaceFieldDetectorModifier<T extends CalculusFieldElement<T>>- Returns:
- the wrapped raw detector
-
getHandler
public FieldEventHandler<T> getHandler()
Get the handler.- Specified by:
getHandlerin interfaceFieldDetectorModifier<T extends CalculusFieldElement<T>>- Specified by:
getHandlerin interfaceFieldEventDetector<T extends CalculusFieldElement<T>>- Returns:
- event handler to call at event occurrences
-
getDetectionSettings
public FieldEventDetectionSettings<T> getDetectionSettings()
Getter for the settings.- Specified by:
getDetectionSettingsin interfaceFieldDetectorModifier<T extends CalculusFieldElement<T>>- Specified by:
getDetectionSettingsin interfaceFieldEventDetector<T extends CalculusFieldElement<T>>- Returns:
- detection settings
-
getPredicate
public FieldEnablingPredicate<T> getPredicate()
Getter for the enabling predicate.- Returns:
- predicate
- Since:
- 13.1
-
dependsOnTimeOnly
public boolean dependsOnTimeOnly()
Method returning true if and only if the detection function g does not depend on dependent variables, just the independent one i.e. time. This information is used for performance in propagation.- Specified by:
dependsOnTimeOnlyin interfaceFieldDetectorModifier<T extends CalculusFieldElement<T>>- Specified by:
dependsOnTimeOnlyin interfaceFieldEventDetector<T extends CalculusFieldElement<T>>- Returns:
- flag
-
init
public void init(FieldSpacecraftState<T> s0, FieldAbsoluteDate<T> 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 detector to initialize some internal data if needed.
The default implementation initializes the handler.
- Specified by:
initin interfaceFieldDetectorModifier<T extends CalculusFieldElement<T>>- Specified by:
initin interfaceFieldEventDetector<T extends CalculusFieldElement<T>>- Parameters:
s0- initial statet- target time for the integration
-
reset
public void reset(FieldSpacecraftState<T> state, FieldAbsoluteDate<T> target)
Description copied from interface:FieldDetectorModifierReset 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:
resetin interfaceFieldDetectorModifier<T extends CalculusFieldElement<T>>- Specified by:
resetin interfaceFieldEventDetector<T extends CalculusFieldElement<T>>- Parameters:
state- current statetarget- target time for the integration
-
g
public T g(FieldSpacecraftState<T> 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:
gin interfaceFieldDetectorModifier<T extends CalculusFieldElement<T>>- Specified by:
gin interfaceFieldEventDetector<T extends CalculusFieldElement<T>>- 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
-
-