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
Modifier | Constructor and Description |
---|---|
|
FunctionalDetector()
Create an event detector with the default values.
|
protected |
FunctionalDetector(AdaptableInterval maxCheck,
double threshold,
int maxIter,
EventHandler handler,
ToDoubleFunction<SpacecraftState> function)
Private constructor.
|
Modifier and Type | Method and Description |
---|---|
protected FunctionalDetector |
create(AdaptableInterval newMaxCheck,
double newThreshold,
int newMaxIter,
EventHandler 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.
|
getHandler, getMaxCheckInterval, getMaxIterationCount, getThreshold, init, isForward, withHandler, withMaxCheck, withMaxCheck, withMaxIter, withThreshold
public FunctionalDetector()
AbstractDetector.DEFAULT_MAXCHECK
, AbstractDetector.DEFAULT_THRESHOLD
, AbstractDetector.DEFAULT_MAX_ITER
, ContinueOnEvent
, and a g function that is identically unity.protected FunctionalDetector(AdaptableInterval maxCheck, double threshold, int maxIter, EventHandler handler, ToDoubleFunction<SpacecraftState> function)
maxCheck
- maximum checking intervalthreshold
- convergence threshold (s)maxIter
- maximum number of iterations in the event time searchhandler
- event handler to call at event occurrencesfunction
- the switching function.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(AdaptableInterval newMaxCheck, double newThreshold, int newMaxIter, EventHandler 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(AdaptableInterval)
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.