org.orekit.propagation.events
Class AbstractDetector

java.lang.Object
  extended by org.orekit.propagation.events.AbstractDetector
All Implemented Interfaces:
java.io.Serializable, EventDetector
Direct Known Subclasses:
AlignmentDetector, AltitudeDetector, ApsideDetector, CircularFieldOfViewDetector, DateDetector, DihedralFieldOfViewDetector, EclipseDetector, ElevationDetector, EventShifter, NodeDetector

public abstract class AbstractDetector
extends java.lang.Object
implements EventDetector

Common parts shared by several orbital events finders.

Version:
$Revision: 3027 $ $Date: 2010-01-19 11:36:25 +0100 (mar. 19 janv. 2010) $
Author:
Luc Maisonobe
See Also:
Propagator.addEventDetector(EventDetector), Serialized Form

Field Summary
static double DEFAULT_MAXCHECK
          Default maximum checking interval (s).
static double DEFAULT_THRESHOLD
          Default convergence threshold (s).
 
Fields inherited from interface org.orekit.propagation.events.EventDetector
CONTINUE, RESET_DERIVATIVES, RESET_STATE, STOP
 
Constructor Summary
protected AbstractDetector(double maxCheck, double threshold)
          Build a new instance.
 
Method Summary
abstract  int eventOccurred(SpacecraftState s, boolean increasing)
          Handle an event and choose what to do next.
abstract  double g(SpacecraftState s)
          Compute the value of the switching function.
 double getMaxCheckInterval()
          Get maximal time interval between switching function checks.
 int getMaxIterationCount()
          Get maximal number of iterations in the event time search.
 double getThreshold()
          Get the convergence threshold in the event time search.
 SpacecraftState resetState(SpacecraftState oldState)
          Reset the state prior to continue propagation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MAXCHECK

public static final double DEFAULT_MAXCHECK
Default maximum checking interval (s).

See Also:
Constant Field Values

DEFAULT_THRESHOLD

public static final double DEFAULT_THRESHOLD
Default convergence threshold (s).

See Also:
Constant Field Values
Constructor Detail

AbstractDetector

protected AbstractDetector(double maxCheck,
                           double threshold)
Build a new instance.

Parameters:
maxCheck - maximum checking interval (s)
threshold - convergence threshold (s)
Method Detail

eventOccurred

public abstract int eventOccurred(SpacecraftState s,
                                  boolean increasing)
                           throws OrekitException
Handle an event and choose what to do next.

The scheduling between this method and the OrekitStepHandler method handleStep(interpolator, isLast) is to call this method first and handleStep afterwards. This scheduling allows the propagator to pass true as the isLast parameter to the step handler to make it aware the step will be the last one if this method returns EventDetector.STOP. As the interpolator may be used to navigate back throughout the last step (as OrekitStepNormalizer does for example), user code called by this method and user code called by step handlers may experience apparently out of order values of the independent time variable. As an example, if the same user object implements both this EventDetector interface and the OrekitFixedStepHandler interface, a forward integration may call its eventOccurred method with a state at 2000-01-01T00:00:10 first and call its handleStep method with a state at 2000-01-01T00:00:09 afterwards. Such out of order calls are limited to the size of the integration step for variable step handlers and to the size of the fixed step for fixed step handlers.

Specified by:
eventOccurred in interface EventDetector
Parameters:
s - the current state information : date, kinematics, attitude
increasing - if true, the value of the switching function increases when times increases around event (note that increase is measured with respect to physical time, not with respect to propagation which may go backward in time)
Returns:
one of EventDetector.STOP, EventDetector.RESET_STATE, EventDetector.RESET_DERIVATIVES or EventDetector.CONTINUE
Throws:
OrekitException - if some specific error occurs

g

public abstract double g(SpacecraftState s)
                  throws OrekitException
Compute the value of the switching function. This function must be continuous (at least in its roots neighborhood), as the integrator will need to find its roots to locate the events.

Specified by:
g in interface EventDetector
Parameters:
s - the current state information: date, kinematics, attitude
Returns:
value of the switching function
Throws:
OrekitException - if some specific error occurs

getMaxCheckInterval

public double getMaxCheckInterval()
Get maximal time interval between switching function checks.

Specified by:
getMaxCheckInterval in interface EventDetector
Returns:
maximal time interval (s) between switching function checks

getMaxIterationCount

public int getMaxIterationCount()
Get maximal number of iterations in the event time search.

Specified by:
getMaxIterationCount in interface EventDetector
Returns:
maximal number of iterations in the event time search

getThreshold

public double getThreshold()
Get the convergence threshold in the event time search.

Specified by:
getThreshold in interface EventDetector
Returns:
convergence threshold (s)

resetState

public SpacecraftState resetState(SpacecraftState oldState)
Reset the state prior to continue propagation.

This method is called after the step handler has returned and before the next step is started, but only when EventDetector.eventOccurred(org.orekit.propagation.SpacecraftState, boolean) has itself returned the EventDetector.RESET_STATE indicator. It allows the user to reset the state for the next step, without perturbing the step handler of the finishing step. If the EventDetector.eventOccurred(org.orekit.propagation.SpacecraftState, boolean) never returns the EventDetector.RESET_STATE indicator, this function will never be called, and it is safe to simply return null.

Specified by:
resetState in interface EventDetector
Parameters:
oldState - old state
Returns:
new state


Copyright © 2002-2010 CS Communication & Systèmes. All Rights Reserved.