Class IntervalEventTrigger<T extends AbstractDetector<T>>
- java.lang.Object
-
- org.orekit.forces.maneuvers.trigger.AbstractManeuverTriggers
-
- org.orekit.forces.maneuvers.trigger.IntervalEventTrigger<T>
-
- Type Parameters:
T
- type of the interval detector
- All Implemented Interfaces:
ManeuverTriggers
,ResettableManeuverTriggers
,EventDetectorsProvider
,ParameterDriversProvider
- Direct Known Subclasses:
DateBasedManeuverTriggers
public abstract class IntervalEventTrigger<T extends AbstractDetector<T>> extends AbstractManeuverTriggers
Maneuver triggers based on a single event detector that defines firing intervals.Firing intervals correspond to time spans with positive value of the event detector
g
function.- Since:
- 11.1
- Author:
- Luc Maisonobe
- See Also:
StartStopEventsTrigger
-
-
Field Summary
-
Fields inherited from interface org.orekit.propagation.events.EventDetectorsProvider
DATATION_ACCURACY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
IntervalEventTrigger(T prototypeFiringIntervalDetector)
Simple constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract <D extends FieldAbstractDetector<D,S>,S extends CalculusFieldElement<S>>
FieldAbstractDetector<D,S>convertIntervalDetector(Field<S> field, T detector)
Convert a primitive firing intervals detector into a field firing intervals detector.Stream<EventDetector>
getEventDetectors()
Get the discrete events related to the model.<S extends CalculusFieldElement<S>>
Stream<FieldEventDetector<S>>getFieldEventDetectors(Field<S> field)
Get the discrete events related to the model.T
getFiringIntervalDetector()
Getter for the firing interval detector.<D extends CalculusFieldElement<D>>
voidinit(FieldSpacecraftState<D> initialState, FieldAbsoluteDate<D> target)
Initialization method called at propagation start.void
init(SpacecraftState initialState, AbsoluteDate target)
Initialization method called at propagation start.protected boolean
isFiringOnInitialState(SpacecraftState initialState, boolean isForward)
Method to check if the thruster is firing on initialization.-
Methods inherited from class org.orekit.forces.maneuvers.trigger.AbstractManeuverTriggers
addResetter, addResetter, applyResetters, applyResetters, getFirings, initializeResetters, initializeResetters, isFiring, isFiring, notifyResetters, notifyResetters
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.orekit.propagation.events.EventDetectorsProvider
getDateDetector, getEventDetectors, getFieldDateDetector, getFieldEventDetectors
-
Methods inherited from interface org.orekit.forces.maneuvers.trigger.ManeuverTriggers
getName
-
Methods inherited from interface org.orekit.utils.ParameterDriversProvider
getNbParametersDriversValue, getParameterDriver, getParameters, getParameters, getParameters, getParameters, getParametersAllValues, getParametersAllValues, getParametersDrivers, isSupported
-
-
-
-
Constructor Detail
-
IntervalEventTrigger
protected IntervalEventTrigger(T prototypeFiringIntervalDetector)
Simple constructor.Note that the
intervalDetector
passed as an argument is used only as a prototype from which a new detector will be built using itswithHandler
method to set up an internal handler. The original event handler from the prototype will be ignored and never called.If the trigger is used in a
field-based propagation
, the detector will be automatically converted to a field equivalent. Beware however that theeventOccurred
of the converted propagator will call the method with the same name in the prototype detector, in order to get the correct return value.- Parameters:
prototypeFiringIntervalDetector
- prototype detector for firing interval
-
-
Method Detail
-
init
public void init(SpacecraftState initialState, AbsoluteDate target)
Initialization method called at propagation start.The default implementation does nothing.
- Specified by:
init
in interfaceManeuverTriggers
- Overrides:
init
in classAbstractManeuverTriggers
- Parameters:
initialState
- initial spacecraft state (at the start of propagation).target
- date of propagation. Not equal toinitialState.getDate()
.
-
init
public <D extends CalculusFieldElement<D>> void init(FieldSpacecraftState<D> initialState, FieldAbsoluteDate<D> target)
Initialization method called at propagation start.The default implementation does nothing.
- Specified by:
init
in interfaceManeuverTriggers
- Overrides:
init
in classAbstractManeuverTriggers
- Type Parameters:
D
- type of the elements- Parameters:
initialState
- initial spacecraft state (at the start of propagation).target
- date of propagation. Not equal toinitialState.getDate()
.
-
getFiringIntervalDetector
public T getFiringIntervalDetector()
Getter for the firing interval detector.- Returns:
- firing interval detector
-
isFiringOnInitialState
protected boolean isFiringOnInitialState(SpacecraftState initialState, boolean isForward)
Method to check if the thruster is firing on initialization. can be called by sub classes- Specified by:
isFiringOnInitialState
in classAbstractManeuverTriggers
- Parameters:
initialState
- initial spacecraft stateisForward
- if true, propagation will be in the forward direction- Returns:
- true if firing in propagation direction
-
getEventDetectors
public Stream<EventDetector> getEventDetectors()
Get the discrete events related to the model.This method is not intended to be called several time, only once by a propagator, as it has the side effect of rebuilding the events detectors when called
- Returns:
- stream of event detectors
-
getFieldEventDetectors
public <S extends CalculusFieldElement<S>> Stream<FieldEventDetector<S>> getFieldEventDetectors(Field<S> field)
Get the discrete events related to the model.This method is not intended to be called several time, only once by a propagator, as it has the side effect of rebuilding the events detectors when called
- Type Parameters:
S
- extends CalculusFieldElement<T>- Parameters:
field
- field to which the state belongs- Returns:
- stream of event detectors
-
convertIntervalDetector
protected abstract <D extends FieldAbstractDetector<D,S>,S extends CalculusFieldElement<S>> FieldAbstractDetector<D,S> convertIntervalDetector(Field<S> field, T detector)
Convert a primitive firing intervals detector into a field firing intervals detector.There is not need to set up
withMaxCheck
,withThreshold
, orwithHandler
in the converted detector, this will be done by caller.A skeleton implementation of this method to convert some
XyzDetector
intoFieldXyzDetector
, considering these detectors are created from a date and a number parameter is:protected <D extends FieldEventDetector<S>, S extends CalculusFieldElement<S>> FieldAbstractDetector<D, S> convertIntervalDetector(final Field<S> field, final XyzDetector detector) { final FieldAbsoluteDate<S> date = new FieldAbsoluteDate<>(field, detector.getDate()); final S param = field.getZero().newInstance(detector.getParam()); final FieldAbstractDetector<D, S> converted = (FieldAbstractDetector<D, S>) new FieldXyzDetector<>(date, param); return converted; }
- Type Parameters:
D
- type of the event detectorS
- type of the field elements- Parameters:
field
- field to which the state belongsdetector
- primitive firing intervals detector to convert- Returns:
- converted firing intervals detector
-
-