public class DateDetector extends AbstractDetector<DateDetector> 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(TimeStamped...)
)addEventDate(AbsoluteDate)
)The gap between the added dates must be more than the minGap.
The default implementation behavior is to stop
propagation at the first event date occurrence. This can be changed by calling
AbstractDetector.withHandler(EventHandler)
after construction.
Propagator.addEventDetector(EventDetector)
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_MAX_CHECK
Default value for max check.
|
static double |
DEFAULT_MIN_GAP
Default value for minimum gap between added dates.
|
static double |
DEFAULT_THRESHOLD
Default value for convergence threshold.
|
DEFAULT_MAX_ITER, DEFAULT_MAXCHECK
Modifier | Constructor and Description |
---|---|
protected |
DateDetector(AdaptableInterval maxCheck,
double threshold,
int maxIter,
EventHandler handler,
double minGap,
TimeStamped... dates)
Protected constructor with full parameters.
|
|
DateDetector(TimeStamped... dates)
Build a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addEventDate(AbsoluteDate target)
Add an event date.
|
protected DateDetector |
create(AdaptableInterval newMaxCheck,
double newThreshold,
int newMaxIter,
EventHandler newHandler)
Build a new instance.
|
double |
g(SpacecraftState s)
Compute the value of the switching function.
|
AbsoluteDate |
getDate()
Get the current event date according to the propagator.
|
List<TimeStamped> |
getDates()
Get all event dates currently managed, in chronological order.
|
DateDetector |
withMinGap(double newMinGap)
Setup minimum gap between added dates.
|
getHandler, getMaxCheckInterval, getMaxIterationCount, getThreshold, init, isForward, withHandler, withMaxCheck, withMaxCheck, withMaxIter, withThreshold
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
durationFrom
public static final double DEFAULT_MAX_CHECK
public static final double DEFAULT_MIN_GAP
public static final double DEFAULT_THRESHOLD
public DateDetector(TimeStamped... dates)
First event dates are set here, but others can be
added later with addEventDate(AbsoluteDate)
.
dates
- list of event datesaddEventDate(AbsoluteDate)
protected DateDetector(AdaptableInterval maxCheck, double threshold, int maxIter, EventHandler handler, double minGap, TimeStamped... dates)
This constructor is not public as users are expected to use the builder
API with the various withXxx()
methods to set up the instance
in a readable manner without using a huge amount of parameters.
maxCheck
- maximum checking intervalthreshold
- convergence threshold (s)maxIter
- maximum number of iterations in the event time searchhandler
- event handler to call at event occurrencesminGap
- minimum gap between added dates (s)dates
- list of event datespublic DateDetector withMinGap(double newMinGap)
newMinGap
- new minimum gap between added datesprotected DateDetector create(AdaptableInterval newMaxCheck, double newThreshold, int newMaxIter, EventHandler newHandler)
create
in class AbstractDetector<DateDetector>
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 List<TimeStamped> getDates()
public double g(SpacecraftState s)
g
in interface EventDetector
g
in class AbstractDetector<DateDetector>
s
- the current state information: date, kinematics, attitudepublic AbsoluteDate getDate()
getDate
in interface TimeStamped
public void addEventDate(AbsoluteDate target) throws IllegalArgumentException
The date to add must be:
target
- target dateIllegalArgumentException
- if the date is too close from already defined intervalDateDetector(TimeStamped...)
Copyright © 2002-2023 CS GROUP. All rights reserved.