public class FunctionalDetector extends AbstractDetector<FunctionalDetector>
g(SpacecraftState)
function using a lambda that
can be set using withFunction(ToDoubleFunction)
.
For example, to create a simple date detector use:
FunctionalDetector d = new FunctionalDetector() .withGFunction((s) -> s.getDate().durationFrom(triggerDate)) .withMaxCheck(1e10);
DEFAULT_MAX_ITER, DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
Constructor and Description |
---|
FunctionalDetector()
Create an event detector with the default values.
|
Modifier and Type | Method and 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.
|
ToDoubleFunction<SpacecraftState> |
getFunction()
Get the switching function.
|
FunctionalDetector |
withFunction(ToDoubleFunction<SpacecraftState> 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)
AbstractDetector
g
in interface EventDetector
g
in class AbstractDetector<FunctionalDetector>
s
- the current state information: date, kinematics, attitudeprotected 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 withFunction(ToDoubleFunction<SpacecraftState> newGFunction)
AbstractDetector.withMaxCheck(double)
and AbstractDetector.withThreshold(double)
to set appropriate values for this g function.newGFunction
- the new g function.public ToDoubleFunction<SpacecraftState> getFunction()
g(SpacecraftState)
.Copyright © 2002-2023 CS GROUP. All rights reserved.