T
- the type of numbers this detector uses.public class FieldFunctionalDetector<T extends org.hipparchus.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
Modifier | Constructor and Description |
---|---|
|
FieldFunctionalDetector(org.hipparchus.Field<T> field)
Create an event detector with the default values.
|
protected |
FieldFunctionalDetector(FieldAdaptableInterval<T> maxCheck,
T threshold,
int maxIter,
FieldEventHandler<T> handler,
Function<FieldSpacecraftState<T>,T> function)
Private constructor.
|
Modifier and Type | Method and Description |
---|---|
protected FieldFunctionalDetector<T> |
create(FieldAdaptableInterval<T> newMaxCheck,
T newThreshold,
int newMaxIter,
FieldEventHandler<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.
|
getHandler, getMaxCheckInterval, getMaxIterationCount, getThreshold, init, isForward, withHandler, withMaxCheck, withMaxCheck, withMaxIter, withThreshold
public FieldFunctionalDetector(org.hipparchus.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.protected FieldFunctionalDetector(FieldAdaptableInterval<T> maxCheck, T threshold, int maxIter, FieldEventHandler<T> handler, Function<FieldSpacecraftState<T>,T> 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 T g(FieldSpacecraftState<T> s)
FieldAbstractDetector
g
in interface FieldEventDetector<T extends org.hipparchus.CalculusFieldElement<T>>
g
in class FieldAbstractDetector<FieldFunctionalDetector<T extends org.hipparchus.CalculusFieldElement<T>>,T extends org.hipparchus.CalculusFieldElement<T>>
s
- the current state information: date, kinematics, attitudeprotected FieldFunctionalDetector<T> create(FieldAdaptableInterval<T> newMaxCheck, T newThreshold, int newMaxIter, FieldEventHandler<T> newHandler)
FieldAbstractDetector
create
in class FieldAbstractDetector<FieldFunctionalDetector<T extends org.hipparchus.CalculusFieldElement<T>>,T extends org.hipparchus.CalculusFieldElement<T>>
newMaxCheck
- maximum checking intervalnewThreshold
- 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(FieldAdaptableInterval)
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-2023 CS GROUP. All rights reserved.