AnomalyEvent 4.5.1

De Wiki
Révision de 17 août 2020 à 08:48 par Admin (discussion | contributions) (Page créée avec « <syntaxhighlight lang="java"> public class AnomalyEvent { public static void main(String[] args) throws PatriusException { final ArrayList<AnomalyDet... »)

(diff) ← Version précédente | Voir la version courante (diff) | Version suivante → (diff)
Aller à : navigation, rechercher
public class AnomalyEvent {
 
    public static void main(String[] args) throws PatriusException {
 
        final ArrayList<AnomalyDetector> detectorList = new ArrayList<AnomalyDetector>();
 
        // AOL event with default values
        final AnomalyDetector anoEvent1 = new AnomalyDetector(PositionAngle.TRUE, FastMath.PI);
        detectorList.add(anoEvent1);
 
        // Same event with customized convergence values
        final double maxCheck = 0.5 * AbstractDetector.DEFAULT_MAXCHECK;
        final double threshold = 2. * AbstractDetector.DEFAULT_THRESHOLD;
        final AnomalyDetector anoEvent2 = new AnomalyDetector(PositionAngle.TRUE, FastMath.PI, maxCheck, threshold);
        detectorList.add(anoEvent2);
 
        // Same event with customized convergence values and specifying the action to be done when events occured
        final AnomalyDetector anoEvent3 = new AnomalyDetector(PositionAngle.TRUE, FastMath.PI, maxCheck, threshold, Action.STOP);
        detectorList.add(anoEvent3);
 
        // Same event with customized convergence values, specifying the action to be done when events occured
        // and specifying the event is removed once it is occured
        final AnomalyDetector anoEvent4 = new AnomalyDetector(PositionAngle.TRUE, FastMath.PI, maxCheck, threshold, Action.STOP, true);
        detectorList.add(anoEvent4);
 
        for ( AnomalyDetector anomalyDetector : detectorList ) {
            System.out.println("Anomaly of the event: " + FastMath.toDegrees(anomalyDetector.getAnomaly()) + " deg");
            System.out.println("Anomaly of the event: " + anomalyDetector.getAnomalyType());
            System.out.println("Max check interval of the event: " + anomalyDetector.getMaxCheckInterval() + " s");
            System.out.println("Threshold of the event: " + anomalyDetector.getThreshold() + " s");
            System.out.println("Remove the event after occuring: " + anomalyDetector.shouldBeRemoved());
            System.out.println();
            System.out.println("Slope selection of the event: " + anomalyDetector.getSlopeSelection());
            System.out.println("Max iteration count of the event: " + anomalyDetector.getMaxIterationCount());
            System.out.println();
        }
 
    }
 
}