This is an automated email from the ASF dual-hosted git repository.

leirui pushed a commit to branch research/LTS-visualization
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 0c93bdc7c1fed26dd1fee7c8ec0f56b7c34e1576
Author: Lei Rui <1010953...@qq.com>
AuthorDate: Wed Jul 17 04:54:11 2024 +0800

    add
---
 .../iotdb/db/query/simpiece/MySample_fsw.java      | 24 ++++++++++--------
 .../db/query/simpiece/MySample_shrinkingcone.java  | 25 +++++++++++--------
 .../simpiece/MySample_shrinkingcone_full.java      |  2 +-
 .../iotdb/db/query/simpiece/MySample_simpiece.java | 29 ++++++++++++----------
 4 files changed, 44 insertions(+), 36 deletions(-)

diff --git 
a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_fsw.java 
b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_fsw.java
index ed4eefe0b50..da43f5b824e 100644
--- a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_fsw.java
+++ b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_fsw.java
@@ -32,18 +32,20 @@ public class MySample_fsw {
   public static void main(String[] args) {
     String fileDir = "D:\\desktop\\NISTPV\\";
     String[] datasetNameList =
-        new String[] {
-          "NISTPV-Ground-2015-Qloss_Ah",
-          "NISTPV-Ground-2015-Pyra1_Wm2",
-          "NISTPV-Ground-2015-RTD_C_3"
+        new String[]{
+            "NISTPV-Ground-2015-Qloss_Ah",
+            "NISTPV-Ground-2015-Pyra1_Wm2",
+            "NISTPV-Ground-2015-RTD_C_3",
+            "NISTPV-Ground-2015-WindSpeed_ms"
         };
-    int[] noutList = new int[] {100};
-    double[] r = new double[] {0.1, 0.5, 1.3};
-    double[] epsilonList = new double[] {9.999999E-4, 284.4034399986267, 
6.428162097930908};
-    for (int y = 0; y < datasetNameList.length; y++) {
+    int[] noutList = new int[]{100};
+    double[] r = new double[]{0.1, 0.5, 1.3, 0};
+    int[] NList = new int[]{2500000, 2500000, 2500000, 500000};
+    double[] epsilonList = new double[]{9.999999E-4, 284.4034399986267, 
6.428162097930908,10.814893245697021};
+    for (int y = 3; y < datasetNameList.length; y++) {
       String datasetName = datasetNameList[y];
-      int start = (int) (10000000 / 2 - 2500000 * r[y]); // 从0开始计数
-      int end = (int) (10000000 / 2 + 2500000 * (1 - r[y]));
+      int start = (int) (10000000 / 2 - NList[y] * r[y]); // 从0开始计数
+      int end = (int) (10000000 / 2 + NList[y] * (1 - r[y]));
       int N = end - start;
       //      int start = 0;
       //      int end = 10000;
@@ -56,7 +58,7 @@ public class MySample_fsw {
           TimeSeries ts =
               TimeSeriesReader.getMyTimeSeries(
                   inputStream, delimiter, false, N, start, hasHeader, false);
-          //          double epsilon = getFSWParam(nout, ts, 1e-6);
+//          double epsilon = getFSWParam(nout, ts, 1e-6);
           double epsilon = epsilonList[y];
           List<Point> reducedPoints = FSW.reducePoints(ts.data, epsilon);
           System.out.println(
diff --git 
a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_shrinkingcone.java
 
b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_shrinkingcone.java
index d09641736fd..1b167064f62 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_shrinkingcone.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_shrinkingcone.java
@@ -32,18 +32,21 @@ public class MySample_shrinkingcone {
   public static void main(String[] args) {
     String fileDir = "D:\\desktop\\NISTPV\\";
     String[] datasetNameList =
-        new String[] {
-          "NISTPV-Ground-2015-Qloss_Ah",
-          "NISTPV-Ground-2015-Pyra1_Wm2",
-          "NISTPV-Ground-2015-RTD_C_3"
+        new String[]{
+            "NISTPV-Ground-2015-Qloss_Ah",
+            "NISTPV-Ground-2015-Pyra1_Wm2",
+            "NISTPV-Ground-2015-RTD_C_3",
+            "NISTPV-Ground-2015-WindSpeed_ms"
         };
-    int[] noutList = new int[] {100};
-    double[] r = new double[] {0.1, 0.5, 1.3};
-    double[] epsilonList = new double[] {0.001, 408.55843019485474, 
7.996772289276123};
-    for (int y = 0; y < datasetNameList.length; y++) {
+    int[] noutList = new int[]{100};
+    double[] r = new double[]{0.1, 0.5, 1.3, 0};
+    int[] NList = new int[]{2500000, 2500000, 2500000, 500000};
+    double[] epsilonList = new double[]{0.001, 408.55843019485474, 
7.996772289276123,
+        14.692305088043213};
+    for (int y = 3; y < datasetNameList.length; y++) {
       String datasetName = datasetNameList[y];
-      int start = (int) (10000000 / 2 - 2500000 * r[y]); // 从0开始计数
-      int end = (int) (10000000 / 2 + 2500000 * (1 - r[y]));
+      int start = (int) (10000000 / 2 - NList[y] * r[y]); // 从0开始计数
+      int end = (int) (10000000 / 2 + NList[y] * (1 - r[y]));
       int N = end - start;
       //      int start = 0;
       //      int end = 10000;
@@ -56,7 +59,7 @@ public class MySample_shrinkingcone {
           TimeSeries ts =
               TimeSeriesReader.getMyTimeSeries(
                   inputStream, delimiter, false, N, start, hasHeader, false);
-          //          double epsilon = getSCParam(nout, ts, 1e-6);
+//          double epsilon = getSCParam(nout, ts, 1e-6);
           double epsilon = epsilonList[y];
           List<Point> reducedPoints = ShrinkingCone.reducePoints(ts.data, 
epsilon);
           System.out.println(
diff --git 
a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_shrinkingcone_full.java
 
b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_shrinkingcone_full.java
index d0c7aeef63d..6cb8dd16a92 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_shrinkingcone_full.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_shrinkingcone_full.java
@@ -92,7 +92,7 @@ public class MySample_shrinkingcone_full {
       int end = 1000_0000;
       int N = end - start;
       boolean hasHeader = false;
-      try (FileInputStream inputStream = new FileInputStream(fileDir + 
datasetName + ".csv")) {
+      try (FileInputStream inputStream = new  FileInputStream(fileDir + 
datasetName + ".csv")) {
         String delimiter = ",";
         TimeSeries ts =
             TimeSeriesReader.getMyTimeSeries(
diff --git 
a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_simpiece.java
 
b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_simpiece.java
index 9d7afe6fca8..8792c3a327e 100644
--- 
a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_simpiece.java
+++ 
b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_simpiece.java
@@ -33,18 +33,21 @@ public class MySample_simpiece {
   public static void main(String[] args) {
     String fileDir = "D:\\desktop\\NISTPV\\";
     String[] datasetNameList =
-        new String[] {
-          "NISTPV-Ground-2015-Qloss_Ah",
-          "NISTPV-Ground-2015-Pyra1_Wm2",
-          "NISTPV-Ground-2015-RTD_C_3"
+        new String[]{
+            "NISTPV-Ground-2015-Qloss_Ah",
+            "NISTPV-Ground-2015-Pyra1_Wm2",
+            "NISTPV-Ground-2015-RTD_C_3",
+            "NISTPV-Ground-2015-WindSpeed_ms"
         };
-    int[] noutList = new int[] {100};
-    double[] r = new double[] {0.1, 0.5, 1.3};
-    double[] epsilonList = new double[] {0.0009999, 316.5642651891633, 
9.186667042922977};
-    for (int y = 0; y < datasetNameList.length; y++) {
+    int[] noutList = new int[]{100};
+    double[] r = new double[]{0.1, 0.5, 1.3, 0};
+    double[] epsilonList = new double[]{0.0009999, 316.5642651891633, 
9.186667042922977,
+        11.162719900131227};
+    int[] NList = new int[]{2500000, 2500000, 2500000, 500000};
+    for (int y = 3; y < datasetNameList.length; y++) {
       String datasetName = datasetNameList[y];
-      int start = (int) (10000000 / 2 - 2500000 * r[y]); // 从0开始计数
-      int end = (int) (10000000 / 2 + 2500000 * (1 - r[y]));
+      int start = (int) (10000000 / 2 - NList[y] * r[y]); // 从0开始计数
+      int end = (int) (10000000 / 2 + NList[y] * (1 - r[y]));
       int N = end - start;
       //      int start = 0;
       //      int end = 10000;
@@ -58,7 +61,7 @@ public class MySample_simpiece {
           TimeSeries ts =
               TimeSeriesReader.getMyTimeSeries(
                   inputStream, delimiter, false, N, start, hasHeader, false);
-          //          double epsilon = getSimPieceParam(nout, ts, 1e-6);
+//          double epsilon = getSimPieceParam(nout, ts, 1e-6);
           double epsilon = epsilonList[y];
           SimPiece simPiece = new SimPiece(ts.data, epsilon);
           System.out.println(
@@ -83,7 +86,7 @@ public class MySample_simpiece {
               // end point of this segment
               double v =
                   (segments.get(i + 1).getInitTimestamp() - 
segments.get(i).getInitTimestamp())
-                          * segments.get(i).getA()
+                      * segments.get(i).getA()
                       + segments.get(i).getB();
               writer.println(segments.get(i + 1).getInitTimestamp() + "," + v);
             }
@@ -94,7 +97,7 @@ public class MySample_simpiece {
                     + segments.get(segments.size() - 1).getB());
             double v =
                 (simPiece.lastTimeStamp - segments.get(segments.size() - 
1).getInitTimestamp())
-                        * segments.get(segments.size() - 1).getA()
+                    * segments.get(segments.size() - 1).getA()
                     + segments.get(segments.size() - 1).getB();
             writer.println(simPiece.lastTimeStamp + "," + v);
           }

Reply via email to