public class NthOccurrenceDetector extends IntervalOccurrenceDetector
However the IntervalOccurrenceDetector.eventOccurred(SpacecraftState, boolean, boolean) method is triggered at every event of the
underlying detector. As a result, the behaviour of this detector is the following:
IntervalOccurrenceDetector.eventOccurred(SpacecraftState, boolean, boolean) returns
Action.CONTINUE.IntervalOccurrenceDetector.eventOccurred(SpacecraftState, boolean, boolean) returns the user-provided
action.
Warning: the IntervalOccurrenceDetector.eventOccurred(SpacecraftState, boolean, boolean) method is triggered at every
occurrence of the underlying detector, not only at nth occurrence. Hence, overloading this detector should be
performed carefully: in the overloaded eventOccurred() method, the check IntervalOccurrenceDetector.getCurrentOccurrence() ==
getOccurence() should be performed first to ensure we are at nth occurrence before calling
super.eventOccurred().
EventDetector.ActionDECREASING, INCREASING, INCREASING_DECREASING| Constructor and Description |
|---|
NthOccurrenceDetector(EventDetector eventToDetect,
int occurrence,
EventDetector.Action actionAtOccurrence)
Constructor.
|
NthOccurrenceDetector(EventDetector eventToDetect,
int occurrence,
EventDetector.Action actionAtOccurrence,
boolean remove)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getOccurence()
Get the occurrence to detect.
|
copy, eventOccurred, g, getActionAtOccurrence, getCurrentOccurrence, getEvent, getFirstOccurrence, getLastOccurrence, getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getStep, getThreshold, init, isRemoveAtOccurrence, processEventOccurrence, resetState, shouldBeRemoved, toStringpublic NthOccurrenceDetector(EventDetector eventToDetect, int occurrence, EventDetector.Action actionAtOccurrence)
eventToDetect - event to detectoccurrence - occurrence of the event to detectactionAtOccurrence - action at event nth occurrencepublic NthOccurrenceDetector(EventDetector eventToDetect, int occurrence, EventDetector.Action actionAtOccurrence, boolean remove)
eventToDetect - event to detectoccurrence - occurrence of the event to detectactionAtOccurrence - action at event nth occurrenceremove - true if detector should be removed after detection of nth occurrenceCopyright © 2020 CNES. All rights reserved.