Class BooleanDetector
- All Implemented Interfaces:
EventDetector
One example for an imaging satellite might be to only detect events when a satellite is overhead (elevation > 0) AND when the ground point is sunlit (Sun elevation > 0). Another slightly contrived example using the OR operator would be to detect access to a set of ground stations and only report events when the satellite enters or leaves the field of view of the set, but not hand-offs between the ground stations.
For the BooleanDetector is important that the sign of the g function of the
underlying event detector is not arbitrary, but has a semantic meaning, e.g. in or out,
true or false. This class works well with event detectors that detect entry to or exit
from a region, e.g. EclipseDetector, ElevationDetector, LatitudeCrossingDetector. Using this detector with detectors that are not based on
entry to or exit from a region, e.g. DateDetector, LongitudeCrossingDetector, will likely lead to unexpected results. To apply conditions
to this latter type of event detectors a EventEnablingPredicateFilter is
usually more appropriate.
- Author:
- Evan Ward
- See Also:
-
Field Summary
Fields inherited from class org.orekit.propagation.events.AbstractDetector
DEFAULT_MAX_CHECK, DEFAULT_MAX_ITER, DEFAULT_THRESHOLD -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBooleanDetector(List<EventDetector> detectors, BooleanEventFunction eventFunction, EventDetectionSettings detectionSettings, EventHandler newHandler) Protected constructor with all the parameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic BooleanDetectorandCombine(Collection<? extends EventDetector> detectors) Create a new event detector that is the logical AND of the given event detectors.static BooleanDetectorandCombine(EventDetector... detectors) Create a new event detector that is the logical AND of the given event detectors.protected BooleanDetectorcreate(EventDetectionSettings detectionSettings, EventHandler newHandler) Build a new instance.voidfinish(SpacecraftState state) This method finalizes the event detector's job.doubleg(SpacecraftState s) Compute the value of the switching function.Get the list of original detectors.voidinit(SpacecraftState s0, AbsoluteDate t) Initialize event detector at the start of a propagation.static NegateDetectornotCombine(EventDetector detector) Create a new event detector that negates the g function of another detector.static BooleanDetectororCombine(Collection<? extends EventDetector> detectors) Create a new event detector that is the logical OR of the given event detectors.static BooleanDetectororCombine(EventDetector... detectors) Create a new event detector that is the logical OR of the given event detectors.voidreset(SpacecraftState state, AbsoluteDate target) Reset the event detector during propagation when the state is modified by an event or an additional data provider.Methods inherited from class org.orekit.propagation.events.AbstractDetector
checkIfForward, getDetectionSettings, getEventFunction, getHandler, isForward, withDetectionSettings, withHandler, withMaxCheck, withMaxCheck, withMaxIter, withThresholdMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.orekit.propagation.events.EventDetector
getMaxCheckInterval, getMaxIterationCount, getThreshold
-
Constructor Details
-
BooleanDetector
protected BooleanDetector(List<EventDetector> detectors, BooleanEventFunction eventFunction, EventDetectionSettings detectionSettings, EventHandler newHandler) Protected constructor with all the parameters.- Parameters:
detectors- the operands.eventFunction- reduced event function according to boolean operator.detectionSettings- event detection settings.newHandler- event handler.- Since:
- 14.0
-
-
Method Details
-
andCombine
Create a new event detector that is the logical AND of the given event detectors.The created event detector's g function is positive if and only if the g functions of all detectors in
detectorsare positive.The starting interval, threshold, and iteration count are set to the most stringent (minimum) of all the
detectors. The event handlers of the underlyingdetectorsare not used, instead the default handler isContinueOnEvent.- Parameters:
detectors- the operands. Must contain at least one detector.- Returns:
- a new event detector that is the logical AND of the operands.
- Throws:
NoSuchElementException- ifdetectorsis empty.- See Also:
-
andCombine
Create a new event detector that is the logical AND of the given event detectors.The created event detector's g function is positive if and only if the g functions of all detectors in
detectorsare positive.The starting interval, threshold, and iteration count are set to the most stringent (minimum) of the
detectors. The event handlers of the underlyingdetectorsare not used, instead the default handler isContinueOnEvent.- Parameters:
detectors- the operands. Must contain at least one detector.- Returns:
- a new event detector that is the logical AND of the operands.
- Throws:
NoSuchElementException- ifdetectorsis empty.- See Also:
-
orCombine
Create a new event detector that is the logical OR of the given event detectors.The created event detector's g function is positive if and only if at least one of g functions of the event detectors in
detectorsis positive.The starting interval, threshold, and iteration count are set to the most stringent (minimum) of the
detectors. The event handlers of the underlying EventDetectors are not used, instead the default handler isContinueOnEvent.- Parameters:
detectors- the operands. Must contain at least one detector.- Returns:
- a new event detector that is the logical OR of the operands.
- Throws:
NoSuchElementException- ifdetectorsis empty.- See Also:
-
orCombine
Create a new event detector that is the logical OR of the given event detectors.The created event detector's g function is positive if and only if at least one of g functions of the event detectors in
detectorsis positive.The starting interval, threshold, and iteration count are set to the most stringent (minimum) of the
detectors. The event handlers of the underlying EventDetectors are not used, instead the default handler isContinueOnEvent.- Parameters:
detectors- the operands. Must contain at least one detector.- Returns:
- a new event detector that is the logical OR of the operands.
- Throws:
NoSuchElementException- ifdetectorsis empty.- See Also:
-
notCombine
Create a new event detector that negates the g function of another detector.This detector will be initialized with the same
EventDetector.getMaxCheckInterval(),EventDetector.getThreshold(), andEventDetector.getMaxIterationCount()asdetector. The event handler of the underlying detector is not used, instead the default handler isContinueOnEvent.- Parameters:
detector- to negate.- Returns:
- a new event detector whose g function is the same magnitude but opposite
sign of
detector. - See Also:
-
g
Description copied from interface:EventDetectorCompute 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.- Parameters:
s- the current state information: date, kinematics, attitude- Returns:
- value of the switching function
-
create
Description copied from class:AbstractDetectorBuild a new instance.- Specified by:
createin classAbstractDetector<BooleanDetector>- Parameters:
detectionSettings- detection settingsnewHandler- event handler to call at event occurrences- Returns:
- a new instance of the appropriate sub-type
-
init
Description copied from class:AbstractDetectorInitialize 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.
This implementation sets the direction of propagation and initializes the event handler. If a subclass overrides this method it should call
super.init(s0, t).- Specified by:
initin interfaceEventDetector- Overrides:
initin classAbstractDetector<BooleanDetector>- Parameters:
s0- initial statet- target time for the integration
-
reset
Description copied from interface:EventDetectorReset the event detector during propagation when the state is modified by an event or an additional data provider.The default implementation does nothing.
- Parameters:
state- current statetarget- target time for the integration
-
finish
Description copied from interface:EventDetectorThis method finalizes the event detector's job.- Parameters:
state- state at propagation end
-
getDetectors
Get the list of original detectors.- Returns:
- the list of original detectors
- Since:
- 10.2
-