Class IntervalEventTrigger<T extends EventDetector>

    • 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 ManeuverTriggerDetector. 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 the eventOccurred 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 interface ManeuverTriggers
        Overrides:
        init in class AbstractManeuverTriggers
        Parameters:
        initialState - initial spacecraft state (at the start of propagation).
        target - date of propagation. Not equal to initialState.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 class AbstractManeuverTriggers
        Parameters:
        initialState - initial spacecraft state
        isForward - 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 FieldEventDetector<S>,​S extends CalculusFieldElement<S>> D convertIntervalDetector​(Field<S> field,
                                                                                                                               T detector)
        Convert a primitive firing intervals detector into a field firing intervals detector.

        The FieldEventDetectionSettings must be set up in conformance with the non-field detector.

        A skeleton implementation of this method to convert some XyzDetector into FieldXyzDetector, considering these detectors are created from a date and a number parameter is:

        
             protected <D extends FieldEventDetector<S>, S extends CalculusFieldElement<S>>
                 D 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());
        
                 D converted = (D) new FieldXyzDetector<>(date, param).withDetectionSettings(field, detector.getDetectionSettings());
                 return converted;
        
             }
         
         
        Type Parameters:
        D - type of the event detector
        S - type of the field elements
        Parameters:
        field - field to which the state belongs
        detector - primitive firing intervals detector to convert
        Returns:
        converted firing intervals detector