Serializable
, EventDetector
public class FunctionalDetector extends AbstractDetector<FunctionalDetector>
g(SpacecraftState)
function using a
lambda
that can be set using withGFunction(GFunction)
.
For example, to create a simple date detector use:
FunctionalDetector d = new FunctionalDetector()
.withGFunction((s)-> s.getDate().durationFrom(triggerDate))
.withMaxCheck(1e10);
Modifier and Type | Class | Description |
---|---|---|
static interface |
FunctionalDetector.GFunction |
A functional interface for the
g(SpacecraftState) function. |
DEFAULT_MAX_ITER, DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
Constructor | Description |
---|---|
FunctionalDetector() |
Create an event detector with the default values.
|
Modifier and Type | Method | Description |
---|---|---|
protected FunctionalDetector |
create(double newMaxCheck,
double newThreshold,
int newMaxIter,
EventHandler<? super FunctionalDetector> newHandler) |
Build a new instance.
|
double |
g(SpacecraftState s) |
Compute the value of the switching function.
|
FunctionalDetector.GFunction |
getGFunction() |
Get the switching function.
|
FunctionalDetector |
withGFunction(FunctionalDetector.GFunction newGFunction) |
Create a new event detector with a new g function, keeping all other attributes the
same.
|
eventOccurred, getHandler, getMaxCheckInterval, getMaxIterationCount, getThreshold, init, isForward, resetState, withHandler, withMaxCheck, withMaxIter, withThreshold
public FunctionalDetector()
AbstractDetector.DEFAULT_MAXCHECK
, AbstractDetector.DEFAULT_THRESHOLD
, AbstractDetector.DEFAULT_MAX_ITER
, ContinueOnEvent
, and a g function that is identically unity.public double g(SpacecraftState s) throws OrekitException
AbstractDetector
g
in interface EventDetector
g
in class AbstractDetector<FunctionalDetector>
s
- the current state information: date, kinematics, attitudeOrekitException
- if some specific error occursprotected FunctionalDetector create(double newMaxCheck, double newThreshold, int newMaxIter, EventHandler<? super FunctionalDetector> newHandler)
AbstractDetector
create
in class AbstractDetector<FunctionalDetector>
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 FunctionalDetector withGFunction(FunctionalDetector.GFunction newGFunction)
AbstractDetector.withMaxCheck(double)
and
AbstractDetector.withThreshold(double)
to set appropriate values for this g function.newGFunction
- the new g function.public FunctionalDetector.GFunction getGFunction()
g(SpacecraftState)
.Copyright © 2002-2018 CS Systèmes d'information. All rights reserved.