T
- the type of numbers this detector uses.public class FieldFunctionalDetector<T extends CalculusFieldElement<T>> extends FieldAbstractDetector<FieldFunctionalDetector<T>,T>
g(FieldSpacecraftState)
function using a lambda
that can be set using withFunction(Function)
.
For example, to create a simple date detector use:
FieldFunctionalDetector<T> d = new FieldFunctionalDetector<>(field) .withGFunction((s) -> s.getDate().durationFrom(triggerDate)) .withMaxCheck(field.getZero().add(1e10));
DEFAULT_MAX_ITER, DEFAULT_MAXCHECK, DEFAULT_THRESHOLD
Constructor and Description |
---|
FieldFunctionalDetector(Field<T> field)
Create an event detector with the default values.
|
Modifier and Type | Method and Description |
---|---|
protected FieldFunctionalDetector<T> |
create(T newMaxCheck,
T newThreshold,
int newMaxIter,
FieldEventHandler<? super FieldFunctionalDetector<T>,T> newHandler)
Build a new instance.
|
T |
g(FieldSpacecraftState<T> s)
Compute the value of the switching function.
|
Function<FieldSpacecraftState<T>,T> |
getFunction()
Get the switching function.
|
FieldFunctionalDetector<T> |
withFunction(Function<FieldSpacecraftState<T>,T> 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 FieldFunctionalDetector(Field<T> field)
FieldAbstractDetector.DEFAULT_MAXCHECK
, FieldAbstractDetector.DEFAULT_THRESHOLD
, FieldAbstractDetector.DEFAULT_MAX_ITER
, ContinueOnEvent
, and a g function that is identically unity.field
- on which this detector is defined.public T g(FieldSpacecraftState<T> s)
FieldAbstractDetector
g
in interface FieldEventDetector<T extends CalculusFieldElement<T>>
g
in class FieldAbstractDetector<FieldFunctionalDetector<T extends CalculusFieldElement<T>>,T extends CalculusFieldElement<T>>
s
- the current state information: date, kinematics, attitudeprotected FieldFunctionalDetector<T> create(T newMaxCheck, T newThreshold, int newMaxIter, FieldEventHandler<? super FieldFunctionalDetector<T>,T> newHandler)
FieldAbstractDetector
create
in class FieldAbstractDetector<FieldFunctionalDetector<T extends CalculusFieldElement<T>>,T extends CalculusFieldElement<T>>
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 FieldFunctionalDetector<T> withFunction(Function<FieldSpacecraftState<T>,T> newGFunction)
FieldAbstractDetector.withMaxCheck(CalculusFieldElement)
and FieldAbstractDetector.withThreshold(CalculusFieldElement)
to set appropriate values for this g function.newGFunction
- the new g function.public Function<FieldSpacecraftState<T>,T> getFunction()
g(FieldSpacecraftState)
.Copyright © 2002-2022 CS GROUP. All rights reserved.