public class DateDetector extends AbstractDetector implements TimeStamped
This class finds date events (i.e. occurrence of some predefined dates).
As of version 5.1, it is an enhanced date detector:
DateDetector(double,double)
)addEventDate(AbsoluteDate)
)The gap between the added dates must be more than the maxCheck.
The default implementation behavior is to stop
propagation at the first event date
occurrence. This can be changed by using provided constructors.
Propagator.addEventDetector(EventDetector)
,
Serialized FormAbstractDetector.PropagationDelayType
EventDetector.Action
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_MAXCHECK
Default convergence threshold (s).
|
static double |
DEFAULT_THRESHOLD
Default convergence threshold (s).
|
DECREASING, INCREASING, INCREASING_DECREASING
Constructor and Description |
---|
DateDetector(AbsoluteDate target)
Build a new instance.
|
DateDetector(AbsoluteDate target,
double maxCheck,
double threshold)
Build a new instance.
|
DateDetector(AbsoluteDate target,
double maxCheck,
double threshold,
EventDetector.Action action)
Build a new instance.
|
DateDetector(AbsoluteDate target,
double maxCheck,
double threshold,
EventDetector.Action action,
boolean remove)
Build a new instance.
|
DateDetector(double maxCheck,
double threshold)
Build a new instance.
|
DateDetector(double maxCheck,
double threshold,
EventDetector.Action action)
Build a new instance.
|
DateDetector(double maxCheck,
double threshold,
EventDetector.Action action,
boolean remove)
Build a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addEventDate(AbsoluteDate target)
Add an event date.
|
EventDetector |
copy()
A copy of the detector.
|
EventDetector.Action |
eventOccurred(SpacecraftState s,
boolean increasing,
boolean forward)
Handle a date event and choose what to do next.
|
double |
g(SpacecraftState s)
Compute the value of the switching function.
|
EventDetector.Action |
getAction()
Return the action at detection.
|
AbsoluteDate |
getDate()
Get the current event date according to the propagator.
|
boolean |
shouldBeRemoved()
This method is called after
EventDetector.eventOccurred(fr.cnes.sirius.patrius.propagation.SpacecraftState, boolean, boolean) has been triggered. |
getMaxCheckInterval, getMaxIterationCount, getPropagationDelayType, getSignalEmissionDate, getSignalReceptionDate, getSlopeSelection, getThreshold, init, resetState, setPropagationDelayType
public static final double DEFAULT_THRESHOLD
public static final double DEFAULT_MAXCHECK
public DateDetector(double maxCheck, double threshold)
This constructor is dedicated to date detection when the event date is not known before propagating. It can be triggered later by adding some event date, it then acts like a timer.
The default implementation behavior is to stop
propagation at date occurrence.
maxCheck
- maximum checking interval (s)threshold
- convergence threshold (s)addEventDate(AbsoluteDate)
public DateDetector(double maxCheck, double threshold, EventDetector.Action action)
This constructor is dedicated to date detection when the event date is not known before propagating. It can be triggered later by adding some event date, it then acts like a timer.
maxCheck
- maximum checking interval (s)threshold
- convergence threshold (s)action
- action performed at date detectionaddEventDate(AbsoluteDate)
public DateDetector(double maxCheck, double threshold, EventDetector.Action action, boolean remove)
This constructor is dedicated to date detection when the event date is not known before propagating. It can be triggered later by adding some event date, it then acts like a timer.
maxCheck
- maximum checking interval (s)threshold
- convergence threshold (s)action
- action performed at date detectionremove
- true if detector should be removed after first detectionaddEventDate(AbsoluteDate)
public DateDetector(AbsoluteDate target, double maxCheck, double threshold)
First event date is set here, but others can be added later with addEventDate(AbsoluteDate)
.
The default implementation behavior is to stop
propagation at date occurrence.
target
- target datemaxCheck
- maximum checking interval (s)threshold
- convergence threshold (s)addEventDate(AbsoluteDate)
public DateDetector(AbsoluteDate target, double maxCheck, double threshold, EventDetector.Action action)
First event date is set here, but others can be added later with addEventDate(AbsoluteDate)
.
target
- target datemaxCheck
- maximum checking interval (s)threshold
- convergence threshold (s)action
- action performed at date detectionaddEventDate(AbsoluteDate)
public DateDetector(AbsoluteDate target, double maxCheck, double threshold, EventDetector.Action action, boolean remove)
First event date is set here, but others can be added later with addEventDate(AbsoluteDate)
.
target
- target datemaxCheck
- maximum checking interval (s)threshold
- convergence threshold (s)action
- action performed at date detectionremove
- true if detector should be removed after first detectionaddEventDate(AbsoluteDate)
public DateDetector(AbsoluteDate target)
This constructor is dedicated to single date detection. MaxCheck is set to 10.e9, so almost no other date can be added. Tolerance is set to 10.e-10.
target
- target dateaddEventDate(AbsoluteDate)
public EventDetector.Action eventOccurred(SpacecraftState s, boolean increasing, boolean forward) throws PatriusException
eventOccurred
in interface EventDetector
eventOccurred
in class AbstractDetector
s
- the current state information : date, kinematics, attitudeincreasing
- the way of the switching function is not guaranted as it can change
according to the added event datesforward
- if true, the integration variable (time) increases during integration.PatriusException
- if some specific error occurspublic boolean shouldBeRemoved()
EventDetector.eventOccurred(fr.cnes.sirius.patrius.propagation.SpacecraftState, boolean, boolean)
has been triggered. It returns true if the
current detector should be removed after first event detection. WARNING: this method
can be called only once a event has been triggered. Before, the value is not available.shouldBeRemoved
in interface EventDetector
shouldBeRemoved
in class AbstractDetector
public double g(SpacecraftState s) throws PatriusException
g
in interface EventDetector
g
in class AbstractDetector
s
- the current state information: date, kinematics, attitudePatriusException
- if some specific error occurspublic AbsoluteDate getDate()
getDate
in interface TimeStamped
public EventDetector.Action getAction()
public void addEventDate(AbsoluteDate target)
The date to add must be:
target
- target dateIllegalArgumentException
- if the date is too close from already defined intervalDateDetector(double, double)
public EventDetector copy()
copy
in interface EventDetector
Copyright © 2021 CNES. All rights reserved.