public class BooleanDetector extends AbstractDetector<BooleanDetector>
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.
andCombine(Collection)
,
orCombine(Collection)
,
notCombine(EventDetector)
,
EventEnablingPredicateFilter
,
EventSlopeFilter
DEFAULT_MAX_ITER, DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
Modifier and Type | Method and Description |
---|---|
static BooleanDetector |
andCombine(Collection<? extends EventDetector> detectors)
Create a new event detector that is the logical AND of the given event detectors.
|
static BooleanDetector |
andCombine(EventDetector... detectors)
Create a new event detector that is the logical AND of the given event detectors.
|
protected BooleanDetector |
create(double newMaxCheck,
double newThreshold,
int newMaxIter,
EventHandler<? super BooleanDetector> newHandler)
Build a new instance.
|
double |
g(SpacecraftState s)
Compute the value of the switching function.
|
List<EventDetector> |
getDetectors()
Get the list of original detectors.
|
void |
init(SpacecraftState s0,
AbsoluteDate t)
Initialize event handler at the start of a propagation.
|
static NegateDetector |
notCombine(EventDetector detector)
Create a new event detector that negates the g function of another detector.
|
static BooleanDetector |
orCombine(Collection<? extends EventDetector> detectors)
Create a new event detector that is the logical OR of the given event detectors.
|
static BooleanDetector |
orCombine(EventDetector... detectors)
Create a new event detector that is the logical OR of the given event detectors.
|
eventOccurred, getHandler, getMaxCheckInterval, getMaxIterationCount, getThreshold, isForward, resetState, withHandler, withMaxCheck, withMaxIter, withThreshold
public static BooleanDetector andCombine(EventDetector... 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
underlying detectors
are not used, instead the default handler is ContinueOnEvent
.
detectors
- the operands. Must contain at least one detector.NoSuchElementException
- if detectors
is empty.BooleanDetector
,
andCombine(Collection)
,
orCombine(EventDetector...)
,
notCombine(EventDetector)
public static BooleanDetector andCombine(Collection<? extends EventDetector> 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
underlying detectors
are not used, instead the default handler is ContinueOnEvent
.
detectors
- the operands. Must contain at least one detector.NoSuchElementException
- if detectors
is empty.BooleanDetector
,
andCombine(EventDetector...)
,
orCombine(Collection)
,
notCombine(EventDetector)
public static BooleanDetector orCombine(EventDetector... 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 is ContinueOnEvent
.
detectors
- the operands. Must contain at least one detector.NoSuchElementException
- if detectors
is empty.BooleanDetector
,
orCombine(Collection)
,
andCombine(EventDetector...)
,
notCombine(EventDetector)
public static BooleanDetector orCombine(Collection<? extends EventDetector> 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 is ContinueOnEvent
.
detectors
- the operands. Must contain at least one detector.NoSuchElementException
- if detectors
is empty.BooleanDetector
,
orCombine(EventDetector...)
,
andCombine(Collection)
,
notCombine(EventDetector)
public static NegateDetector notCombine(EventDetector detector)
This detector will be initialized with the same EventDetector.getMaxCheckInterval()
, EventDetector.getThreshold()
, and
EventDetector.getMaxIterationCount()
as detector
. The event handler
of the underlying detector is not used, instead the default handler is ContinueOnEvent
.
detector
- to negate.detector
.andCombine(Collection)
,
orCombine(Collection)
,
BooleanDetector
public double g(SpacecraftState s)
AbstractDetector
g
in interface EventDetector
g
in class AbstractDetector<BooleanDetector>
s
- the current state information: date, kinematics, attitudeprotected BooleanDetector create(double newMaxCheck, double newThreshold, int newMaxIter, EventHandler<? super BooleanDetector> newHandler)
AbstractDetector
create
in class AbstractDetector<BooleanDetector>
newMaxCheck
- maximum checking interval (s)newThreshold
- convergence threshold (s)newMaxIter
- maximum number of iterations in the event time searchnewHandler
- event handler to call at event occurrencespublic void init(SpacecraftState s0, AbsoluteDate t)
AbstractDetector
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
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)
.
init
in interface EventDetector
init
in class AbstractDetector<BooleanDetector>
s0
- initial statet
- target time for the integrationpublic List<EventDetector> getDetectors()
Copyright © 2002-2022 CS GROUP. All rights reserved.