Class FieldBooleanDetector<T extends CalculusFieldElement<T>>
- java.lang.Object
-
- org.orekit.propagation.events.FieldAbstractDetector<FieldBooleanDetector<T>,T>
-
- org.orekit.propagation.events.FieldBooleanDetector<T>
-
- Type Parameters:
T
- type of the field elements
- All Implemented Interfaces:
FieldEventDetector<T>
public class FieldBooleanDetector<T extends CalculusFieldElement<T>> extends FieldAbstractDetector<FieldBooleanDetector<T>,T>
This class provides AND and OR operations for event detectors. This class treats positive values of the g function as true and negative values as false.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 FieldBooleanDetector 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.
FieldEclipseDetector
,FieldElevationDetector
,FieldLatitudeCrossingDetector
. Using this detector with detectors that are not based on entry to or exit from a region, e.g.FieldDateDetector
, will likely lead to unexpected results. To apply conditions to this latter type of event detectors aFieldEventEnablingPredicateFilter
is usually more appropriate.- Since:
- 12.0
- Author:
- Evan Ward, luc Luc Maisonobe
- See Also:
andCombine(Collection)
,orCombine(Collection)
,notCombine(FieldEventDetector)
,EventEnablingPredicateFilter
,EventSlopeFilter
-
-
Field Summary
-
Fields inherited from class org.orekit.propagation.events.FieldAbstractDetector
DEFAULT_MAX_CHECK, DEFAULT_MAX_ITER, DEFAULT_THRESHOLD
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FieldBooleanDetector(List<FieldEventDetector<T>> detectors, org.orekit.propagation.events.FieldBooleanDetector.Operator operator, FieldEventDetectionSettings<T> detectionSettings, FieldEventHandler<T> newHandler)
Private constructor with all the parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends CalculusFieldElement<T>>
FieldBooleanDetector<T>andCombine(Collection<? extends FieldEventDetector<T>> detectors)
Create a new event detector that is the logical AND of the given event detectors.static <T extends CalculusFieldElement<T>>
FieldBooleanDetector<T>andCombine(FieldEventDetector<T>... detectors)
Create a new event detector that is the logical AND of the given event detectors.protected FieldBooleanDetector<T>
create(FieldEventDetectionSettings<T> detectionSettings, FieldEventHandler<T> newHandler)
Build a new instance.T
g(FieldSpacecraftState<T> s)
Compute the value of the switching function.List<FieldEventDetector<T>>
getDetectors()
Get the list of original detectors.void
init(FieldSpacecraftState<T> s0, FieldAbsoluteDate<T> t)
Initialize event handler at the start of a propagation.static <T extends CalculusFieldElement<T>>
FieldNegateDetector<T>notCombine(FieldEventDetector<T> detector)
Create a new event detector that negates the g function of another detector.static <T extends CalculusFieldElement<T>>
FieldBooleanDetector<T>orCombine(Collection<? extends FieldEventDetector<T>> detectors)
Create a new event detector that is the logical OR of the given event detectors.static <T extends CalculusFieldElement<T>>
FieldBooleanDetector<T>orCombine(FieldEventDetector<T>... detectors)
Create a new event detector that is the logical OR of the given event detectors.-
Methods inherited from class org.orekit.propagation.events.FieldAbstractDetector
getDetectionSettings, getHandler, isForward, withDetectionSettings, withHandler, withMaxCheck, withMaxCheck, withMaxIter, withThreshold
-
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.FieldEventDetector
finish, getMaxCheckInterval, getMaxIterationCount, getThreshold
-
-
-
-
Constructor Detail
-
FieldBooleanDetector
protected FieldBooleanDetector(List<FieldEventDetector<T>> detectors, org.orekit.propagation.events.FieldBooleanDetector.Operator operator, FieldEventDetectionSettings<T> detectionSettings, FieldEventHandler<T> newHandler)
Private constructor with all the parameters.- Parameters:
detectors
- the operands.operator
- reduction operator to apply to value of the g function of the operands.detectionSettings
- event detection settings.newHandler
- event handler.- Since:
- 13.0
-
-
Method Detail
-
andCombine
@SafeVarargs public static <T extends CalculusFieldElement<T>> FieldBooleanDetector<T> andCombine(FieldEventDetector<T>... detectors)
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
detectors
are positive.The starting interval, threshold, and iteration count are set to the most stringent (minimum) of all the
detectors
. The event handlers of the underlyingdetectors
are not used, instead the default handler isFieldContinueOnEvent
.- Type Parameters:
T
- type of the field elements- 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
- ifdetectors
is empty.- See Also:
FieldBooleanDetector
,andCombine(Collection)
,orCombine(FieldEventDetector...)
,notCombine(FieldEventDetector)
-
andCombine
public static <T extends CalculusFieldElement<T>> FieldBooleanDetector<T> andCombine(Collection<? extends FieldEventDetector<T>> detectors)
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
detectors
are positive.The starting interval, threshold, and iteration count are set to the most stringent (minimum) of the
detectors
. The event handlers of the underlyingdetectors
are not used, instead the default handler isFieldContinueOnEvent
.- Type Parameters:
T
- type of the field elements- 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
- ifdetectors
is empty.- See Also:
FieldBooleanDetector
,andCombine(FieldEventDetector...)
,orCombine(Collection)
,notCombine(FieldEventDetector)
-
orCombine
@SafeVarargs public static <T extends CalculusFieldElement<T>> FieldBooleanDetector<T> orCombine(FieldEventDetector<T>... detectors)
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
detectors
is 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 isFieldContinueOnEvent
.- Type Parameters:
T
- type of the field elements- 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
- ifdetectors
is empty.- See Also:
FieldBooleanDetector
,orCombine(Collection)
,andCombine(FieldEventDetector...)
,notCombine(FieldEventDetector)
-
orCombine
public static <T extends CalculusFieldElement<T>> FieldBooleanDetector<T> orCombine(Collection<? extends FieldEventDetector<T>> detectors)
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
detectors
is 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 isFieldContinueOnEvent
.- Type Parameters:
T
- type of the field elements- 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
- ifdetectors
is empty.- See Also:
FieldBooleanDetector
,orCombine(FieldEventDetector...)
,andCombine(Collection)
,notCombine(FieldEventDetector)
-
notCombine
public static <T extends CalculusFieldElement<T>> FieldNegateDetector<T> notCombine(FieldEventDetector<T> detector)
Create a new event detector that negates the g function of another detector.This detector will be initialized with the same
FieldEventDetector.getMaxCheckInterval()
,FieldEventDetector.getThreshold()
, andFieldEventDetector.getMaxIterationCount()
asdetector
. The event handler of the underlying detector is not used, instead the default handler isFieldContinueOnEvent
.- Type Parameters:
T
- type of the field elements- Parameters:
detector
- to negate.- Returns:
- an new event detector whose g function is the same magnitude but opposite
sign of
detector
. - See Also:
andCombine(Collection)
,orCombine(Collection)
,FieldBooleanDetector
-
g
public T g(FieldSpacecraftState<T> s)
Description copied from interface:FieldEventDetector
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.- Parameters:
s
- the current state information: date, kinematics, attitude- Returns:
- value of the switching function
-
create
protected FieldBooleanDetector<T> create(FieldEventDetectionSettings<T> detectionSettings, FieldEventHandler<T> newHandler)
Description copied from class:FieldAbstractDetector
Build a new instance.- Specified by:
create
in classFieldAbstractDetector<FieldBooleanDetector<T extends CalculusFieldElement<T>>,T extends CalculusFieldElement<T>>
- Parameters:
detectionSettings
- detection settingsnewHandler
- event handler to call at event occurrences- Returns:
- a new instance of the appropriate sub-type
-
init
public void init(FieldSpacecraftState<T> s0, FieldAbsoluteDate<T> t)
Description copied from class:FieldAbstractDetector
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.
The default implementation does nothing
- Specified by:
init
in interfaceFieldEventDetector<T extends CalculusFieldElement<T>>
- Overrides:
init
in classFieldAbstractDetector<FieldBooleanDetector<T extends CalculusFieldElement<T>>,T extends CalculusFieldElement<T>>
- Parameters:
s0
- initial statet
- target time for the integration
-
getDetectors
public List<FieldEventDetector<T>> getDetectors()
Get the list of original detectors.- Returns:
- the list of original detectors
-
-