Class PythonStartStopEventsTrigger<A extends AbstractDetector<A>,​O extends AbstractDetector<O>>

    • Constructor Detail

      • PythonStartStopEventsTrigger

        public PythonStartStopEventsTrigger​(A prototypeStartDetector,
                                            O prototypeStopDetector)
        Simple constructor.

        Note that the startDetector and stopDetector passed as an argument are used only as a prototypes from which new detectors will be built using their withHandler methods to set up internal handlers. The original event handlers 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:
        prototypeStartDetector - prototype detector for firing start
        prototypeStopDetector - prototype detector for firing stop
    • Method Detail

      • pythonExtension

        public void pythonExtension​(long pythonObject)
        Part of JCC Python interface to object
      • pythonExtension

        public long pythonExtension()
        Part of JCC Python interface to object
      • pythonDecRef

        public void pythonDecRef()
        Part of JCC Python interface to object
      • convertStartDetector

        public <D extends FieldEventDetector<S>,​S extends CalculusFieldElement<S>> FieldAbstractDetector<D,​S> convertStartDetector​(Field<S> field,
                                                                                                                                               A detector)
        Convert a primitive firing start detector into a field firing start detector.

        There is not need to set up withMaxCheck, withThreshold, or withHandler in the converted detector, this will be done by caller.

        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>>
                 FieldAbstractDetector<D, S> convertStartDetector(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;
        
             }
         
         
        Specified by:
        convertStartDetector in class StartStopEventsTrigger<A extends AbstractDetector<A>,​O extends AbstractDetector<O>>
        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 start detector to convert
        Returns:
        converted firing start detector
      • convertStopDetector

        public <D extends FieldEventDetector<S>,​S extends CalculusFieldElement<S>> FieldAbstractDetector<D,​S> convertStopDetector​(Field<S> field,
                                                                                                                                              O detector)
        Convert a primitive firing stop detector into a field firing stop detector.

        There is not need to set up withMaxCheck, withThreshold, or withHandler in the converted detector, this will be done by caller.

        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>>
                 FieldAbstractDetector<D, S> convertStopDetector(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;
        
             }
         
         
        Specified by:
        convertStopDetector in class StartStopEventsTrigger<A extends AbstractDetector<A>,​O extends AbstractDetector<O>>
        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 stop detector to convert
        Returns:
        converted firing stop detector