public class DistanceDetector extends AbstractDetector
The default implementation behaviour is to EventDetector.Action#STOP stop propagation when the distance is
reached. This can be changed by using provided constructors.
EventDetector,
Serialized FormEventDetector.Action| Modifier and Type | Field and Description |
|---|---|
protected PVCoordinatesProvider |
body
Distant body.
|
static int |
DECREASING
Flag for decreasing distance detection (slopeSelection = 1).
|
protected double |
distance
Distance triggering the event.
|
static int |
INCREASING
Flag for increasing distance detection (slopeSelection = 0).
|
static int |
INCREASING_DECREASING
Flag for both increasing and decreasing distance detection (slopeSelection = 2).
|
actionAtEntry, actionAtExit, DEFAULT_MAXCHECK, DEFAULT_MAXITER, DEFAULT_THRESHOLD, removeAtEntry, removeAtExit, shouldBeRemovedFlag| Constructor and Description |
|---|
DistanceDetector(PVCoordinatesProvider bodyIn,
double distanceIn)
Constructor for a DistanceDetector instance.
|
DistanceDetector(PVCoordinatesProvider bodyIn,
double distanceIn,
double maxCheck,
double threshold)
Constructor for a DistanceDetector instance with additional maxCheck and threshold parameters
The default implementation behavior is to
EventDetector.Action#STOP stop propagation when the distance is
reached. |
DistanceDetector(PVCoordinatesProvider bodyIn,
double distanceIn,
double maxCheck,
double threshold,
EventDetector.Action actionIncreasing,
EventDetector.Action actionDecreasing)
Constructor for a DistanceDetector instance with complimentary parameters.
|
DistanceDetector(PVCoordinatesProvider bodyIn,
double distanceIn,
double maxCheck,
double threshold,
EventDetector.Action actionIncreasing,
EventDetector.Action actionDecreasing,
boolean removeIncreasing,
boolean removeDecreasing)
Constructor for a DistanceDetector instance with complimentary parameters.
|
DistanceDetector(PVCoordinatesProvider bodyIn,
double distanceIn,
int slopeSelection,
double maxCheck,
double threshold,
EventDetector.Action action,
boolean remove)
Build a new altitude detector with slope selection.
|
| Modifier and Type | Method and Description |
|---|---|
EventDetector |
copy()
A copy of the detector.
|
EventDetector.Action |
eventOccurred(SpacecraftState s,
boolean increasing,
boolean forward)
Handle a distance event and choose what to do next.
|
double |
g(SpacecraftState state)
Compute the value of the switching function.
|
PVCoordinatesProvider |
getBody()
Returns the body whose distance is watched.
|
double |
getDistance()
Returns the distance triggering the event.
|
filterEvent, getActionAtEntry, getActionAtExit, getMaxCheckInterval, getMaxIterationCount, getSlopeSelection, getThreshold, init, isRemoveAtEntry, isRemoveAtExit, logEventsOverTimeInterval, resetState, setMaxCheckInterval, setMaxIter, shouldBeRemovedpublic static final int INCREASING
public static final int DECREASING
public static final int INCREASING_DECREASING
protected final double distance
protected final PVCoordinatesProvider body
public DistanceDetector(PVCoordinatesProvider bodyIn, double distanceIn)
This simple constructor takes default values for maximal checking interval (AbstractDetector.DEFAULT_MAXCHECK) and
convergence threshold (AbstractDetector.DEFAULT_THRESHOLD).
The default implementation behavior is to EventDetector.Action#STOP stop propagation when the distance is
reached.
The distanceIn parameter must be positive.
bodyIn - The body whose distance is watched.distanceIn - Distance triggering the event (m)IllegalArgumentException - when the distance is negativepublic DistanceDetector(PVCoordinatesProvider bodyIn, double distanceIn, double maxCheck, double threshold)
The default implementation behavior is to EventDetector.Action#STOP stop propagation when the distance is
reached.
bodyIn - The body whose distance is watcheddistanceIn - Distance triggering the event (m)maxCheck - Maximal checking interval (s)threshold - Convergence threshold (s)IllegalArgumentException - when the distance is negativepublic DistanceDetector(PVCoordinatesProvider bodyIn, double distanceIn, double maxCheck, double threshold, EventDetector.Action actionIncreasing, EventDetector.Action actionDecreasing)
bodyIn - The body whose distance is watcheddistanceIn - Distance triggering the event (m)maxCheck - Maximal checking interval (s)threshold - Convergence threshold (s)actionIncreasing - Action performed at distance detection when distance is increasingactionDecreasing - Action performed at distance detection when distance is decreasingIllegalArgumentException - when the distance is negativepublic DistanceDetector(PVCoordinatesProvider bodyIn, double distanceIn, double maxCheck, double threshold, EventDetector.Action actionIncreasing, EventDetector.Action actionDecreasing, boolean removeIncreasing, boolean removeDecreasing)
bodyIn - The body whose distance is watcheddistanceIn - Distance triggering the event (m)maxCheck - Maximal checking interval (s)threshold - Convergence threshold (s)actionIncreasing - Action performed at distance detection when distance is increasingactionDecreasing - Action performed at distance detection when distance is decreasingremoveIncreasing - True if detector should be removed at increasing distance detectionremoveDecreasing - True if detector should be removed at decreasing distance detectionIllegalArgumentException - when the distance is negativepublic DistanceDetector(PVCoordinatesProvider bodyIn, double distanceIn, int slopeSelection, double maxCheck, double threshold, EventDetector.Action action, boolean remove)
The maximal interval between altitude checks should be smaller than the half duration of the minimal pass to handle, otherwise some short passes could be missed.
bodyIn - The body whose distance is watcheddistanceIn - Distance triggering the event (m)slopeSelection - The g-function slope selection (0,1 or 2)maxCheck - Maximal checking interval (s)threshold - Convergence threshold (s)action - Action performed at distance detectionremove - True if detector should be removed at distance detectionpublic EventDetector.Action eventOccurred(SpacecraftState s, boolean increasing, boolean forward) throws PatriusException
eventOccurred in interface EventDetectoreventOccurred in class AbstractDetectors - the current state information : date, kinematics, attitudeincreasing - if true, the value of the switching function increases when time increases
around eventforward - if true, the integration variable (time) increases during integration.PatriusException - if some specific error occurspublic double g(SpacecraftState state) throws PatriusException
g in interface EventDetectorg in class AbstractDetectorstate - the current state information: date, kinematics, attitude for forces and events
computation, mass provider, and additional statesPatriusException - if some specific error occurspublic double getDistance()
public PVCoordinatesProvider getBody()
public EventDetector copy()
The following attributes are not deeply copied:
PVCoordinatesProviderCopyright © 2024 CNES. All rights reserved.