summaryrefslogtreecommitdiffstats
path: root/examples/examples-adaptive/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/examples-adaptive/src')
-rw-r--r--examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/concepts/AnomalyDetection.java6
-rw-r--r--examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java14
2 files changed, 10 insertions, 10 deletions
diff --git a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/concepts/AnomalyDetection.java b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/concepts/AnomalyDetection.java
index c70c9feb6..9dbfe266f 100644
--- a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/concepts/AnomalyDetection.java
+++ b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/concepts/AnomalyDetection.java
@@ -38,6 +38,9 @@ public class AnomalyDetection implements Serializable {
private boolean firstRound = true;
private int frequency = 0;
+ private List<Double> anomalyScores = new LinkedList<>();
+ private List<Double> frequencyForecasted;
+
/**
* The Constructor creates an AnomalyDetection instance.
*/
@@ -46,9 +49,6 @@ public class AnomalyDetection implements Serializable {
frequency = 0;
}
- private List<Double> anomalyScores = new LinkedList<>();
- private List<Double> frequencyForecasted;
-
/**
* Checks if the AnomalyDetection instance is initialized.
*
diff --git a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java
index 5ee114e0e..ffbaf5905 100644
--- a/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java
+++ b/examples/examples-adaptive/src/main/java/org/onap/policy/apex/examples/adaptive/model/java/AnomalyDetectionPolicyDecideTaskSelectionLogic.java
@@ -47,6 +47,13 @@ public class AnomalyDetectionPolicyDecideTaskSelectionLogic {
private static final double ANOMALY_SENSITIVITY = 0.05;
private static final int FREQUENCY = 360;
+ /*
+ * Some utility methods
+ */
+ // exponential = 2(n+1)
+ private static final double EMA_EXPONENT = 2.0 / (7.0 + 1.0);
+ private static final double EMA_EXPONENT_1 = (1.0 - EMA_EXPONENT);
+
/**
* A map to hold the Anomaly degree/levels/probabilities required for each task.<br>
* If there is no task defined for a calculated anomaly-degree, then the default task is
@@ -295,13 +302,6 @@ public class AnomalyDetectionPolicyDecideTaskSelectionLogic {
return pvalue;
}
- /*
- * Some utility methods
- */
- // exponential = 2(n+1)
- private static final double EMA_EXPONENT = 2.0 / (7.0 + 1.0);
- private static final double EMA_EXPONENT_1 = (1.0 - EMA_EXPONENT);
-
/**
* exponential moving average.
*