From 250c1ae89e99d946b42e2b907ee54fef6a5cadde Mon Sep 17 00:00:00 2001
From: Christian Wulf <chw@informatik.uni-kiel.de>
Date: Tue, 3 Mar 2015 10:32:15 +0100
Subject: [PATCH] limited types of the ports
---
.../stage/opad/AnomalyDetectionFilter.java | 36 ++++++++-----------
1 file changed, 15 insertions(+), 21 deletions(-)
diff --git a/src/main/java/teetime/stage/opad/AnomalyDetectionFilter.java b/src/main/java/teetime/stage/opad/AnomalyDetectionFilter.java
index 49b7b894..9863e7c7 100644
--- a/src/main/java/teetime/stage/opad/AnomalyDetectionFilter.java
+++ b/src/main/java/teetime/stage/opad/AnomalyDetectionFilter.java
@@ -1,4 +1,4 @@
-a/**
+/**
* Copyright (C) 2015 TeeTime (http://teetime.sourceforge.net)
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,43 +17,37 @@ a/**
package teetime.stage.opad;
import teetime.framework.AbstractConsumerStage;
-import teetime.framework.InputPort;
import teetime.framework.OutputPort;
+import kieker.tools.opad.record.ExtendedStorableDetectionResult;
+import kieker.tools.opad.record.StorableDetectionResult;
+
/**
*
* This filter separates input values by their reach of a certain threshold (parameter). It takes events of type {@link StorableDetectionResult} and channels them
* into two output ports, depending on whether the threshold was reached or not. This filter has configuration properties for the (critical) threshold. Although the
* configuration of the critical threshold is possible, the value is currently not used by the filter.
*
- * @author original by: Tillmann Carlos Bielefeld, Thomas Duellmann, Tobias Rudolph
- * @author edit by: Arne Jan Salveter
+ * @author Tillmann Carlos Bielefeld, Thomas Duellmann, Tobias Rudolph, Arne Jan Salveter
* @since 1.10
*
*/
-public class AnomalyDetectionFilter<T> extends AbstractConsumerStage<T> {
-
- private double limit = 0;
- private final OutputPort<T> outputPortNormal = this.createOutputPort();
- private final OutputPort<T> outputPortAnnomal = this.createOutputPort();
- private final OutputPort<T> outputPortAll = this.createOutputPort();
+public class AnomalyDetectionFilter extends AbstractConsumerStage<StorableDetectionResult> {
- private final InputPort<T> inputport = this.createInputPort();
+ private final OutputPort<StorableDetectionResult> outputPortNormal = this.createOutputPort();
+ private final OutputPort<StorableDetectionResult> outputPortAnnomal = this.createOutputPort();
+ private final OutputPort<ExtendedStorableDetectionResult> outputPortAll = this.createOutputPort();
- // _____________End-Attributs__________________________________________________________________________________
+ private final double limit;
- // ______________End-Constructos_____________________________________________________________________
-
- public void setLimit(final double limit) {
+ public AnomalyDetectionFilter(final double limit) {
+ super();
this.limit = limit;
}
- // ______________End-Getter/Setter_____________________________________________________________________________
-
@Override
- protected void execute(final T element) {
-
- if ((StorableDetectionResult) element.getValue() >= limit) {
+ protected void execute(final StorableDetectionResult element) {
+ if (element.getValue() >= limit) {
outputPortAnnomal.send(element);
@@ -66,4 +60,4 @@ public class AnomalyDetectionFilter<T> extends AbstractConsumerStage<T> {
outputPortAll.send(element);
}
-}
\ No newline at end of file
+}
--
GitLab