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 d173f7e4abde973f3de1b063d1f692bd40f5932c Author: Lei Rui <[email protected]> AuthorDate: Mon Sep 23 18:47:20 2024 +0800 test --- .../db/query/simpiece/MySample_fsw_full2.java | 102 ++++++++++++--------- .../simpiece/MySample_shrinkingcone_full2.java | 26 +++++- .../db/query/simpiece/MySample_simpiece_full2.java | 26 +++++- .../iotdb/db/integration/tri/MyTest_ILTS.java | 1 - 4 files changed, 104 insertions(+), 51 deletions(-) diff --git a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_fsw_full2.java b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_fsw_full2.java index 6f5ca979f51..c6db83380b1 100644 --- a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_fsw_full2.java +++ b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_fsw_full2.java @@ -28,51 +28,55 @@ import java.io.PrintWriter; import java.util.List; public class MySample_fsw_full2 { + // After running this, + // output sample csv and copy them into lts-exp/notebook/segmentResults/. + // output epsilonArray_*.txt and copy them into lts-exp/tools/. public static void main(String[] args) { String fileDir = "D:\\desktop\\NISTPV\\"; - String[] datasetNameList = new String[] {"WindSpeed", "Qloss", "Pyra1", "RTD"}; + // do not change the order of datasets below, as the output is used in exp bash + String[] datasetNameList = new String[]{"WindSpeed", "Qloss", "Pyra1", "RTD"}; int[] noutList = - new int[] { - 320, 400, 480, 580, 720, 960, 1200, 1600, 2000, 2400, 3000, 3600, 4000, 4400, 5000 + new int[]{ + 320, 400, 480, 580, 720, 960, 1200, 1600, 2000, 2400, 3000, 3600, 4000, 4400, 5000 }; double[][] epsilonArray = { - { - 9.618271827697754, - 8.991525650024414, - 8.375, - 7.99461555480957, - 7.615596771240234, - 7.172431945800781, - 6.877520561218262, - 6.408135414123535, - 6.219999313354492, - 5.977571487426758, - 5.679183006286621, - 5.499468803405762, - 5.387459754943848, - 5.299999237060547, - 5.1635847091674805, - }, - { - 9.9945068359375E-4, 9.984970092773438E-4, 9.965896606445312E-4, 9.937286376953125E-4, - 9.899139404296875E-4, 9.813308715820312E-4, 9.6893310546875E-4, 9.42230224609375E-4, - 8.983612060546875E-4, 8.268356323242188E-4, 6.685256958007812E-4, 5.197525024414062E-4, - 4.99725341796875E-4, 4.987716674804688E-4, 4.8732757568359375E-4, - }, - { - 440.0235958099365, 423.5567502975464, 405.7711305618286, 396.31347465515137, - 380.6776990890503, 358.0119905471802, 336.5447692871094, 303.85207748413086, - 279.7541666030884, 257.3554916381836, 232.57367420196533, 211.35449981689453, - 200.9514446258545, 192.0128345489502, 178.28646087646484, - }, - { - 9.295397758483887, 7.5366668701171875, 6.473535537719727, 5.6244354248046875, - 4.713288307189941, 3.7258691787719727, 3.078885078430176, 2.4637460708618164, - 2.0368423461914062, 1.7683038711547852, 1.4741735458374023, 1.266657829284668, - 1.1668891906738281, 1.071258544921875, 0.9608230590820312, - } + { + 9.618271827697754, + 8.991525650024414, + 8.375, + 7.99461555480957, + 7.615596771240234, + 7.172431945800781, + 6.877520561218262, + 6.408135414123535, + 6.219999313354492, + 5.977571487426758, + 5.679183006286621, + 5.499468803405762, + 5.387459754943848, + 5.299999237060547, + 5.1635847091674805, + }, + { + 9.9945068359375E-4, 9.984970092773438E-4, 9.965896606445312E-4, 9.937286376953125E-4, + 9.899139404296875E-4, 9.813308715820312E-4, 9.6893310546875E-4, 9.42230224609375E-4, + 8.983612060546875E-4, 8.268356323242188E-4, 6.685256958007812E-4, 5.197525024414062E-4, + 4.99725341796875E-4, 4.987716674804688E-4, 4.8732757568359375E-4, + }, + { + 440.0235958099365, 423.5567502975464, 405.7711305618286, 396.31347465515137, + 380.6776990890503, 358.0119905471802, 336.5447692871094, 303.85207748413086, + 279.7541666030884, 257.3554916381836, 232.57367420196533, 211.35449981689453, + 200.9514446258545, 192.0128345489502, 178.28646087646484, + }, + { + 9.295397758483887, 7.5366668701171875, 6.473535537719727, 5.6244354248046875, + 4.713288307189941, 3.7258691787719727, 3.078885078430176, 2.4637460708618164, + 2.0368423461914062, 1.7683038711547852, 1.4741735458374023, 1.266657829284668, + 1.1668891906738281, 1.071258544921875, 0.9608230590820312, + } }; // double[][] epsilonArray = new double[datasetNameList.length][]; @@ -131,11 +135,25 @@ public class MySample_fsw_full2 { } } - for (int i = 0; i < epsilonArray.length; i++) { - for (int j = 0; j < epsilonArray[i].length; j++) { - System.out.print(epsilonArray[i][j] + ","); +// for (int i = 0; i < epsilonArray.length; i++) { +// for (int j = 0; j < epsilonArray[i].length; j++) { +// System.out.print(epsilonArray[i][j] + ","); +// } +// System.out.println(); +// } + + // do not change name of the output file, as the output is used in exp bash + try (FileWriter writer = new FileWriter("epsilonArray_fsw.txt")) { + for (double[] row : epsilonArray) { + for (double element : row) { + writer.write(element + " "); + System.out.print(element + ","); + } + writer.write("\n"); + System.out.println(); } - System.out.println(); + } catch (IOException e) { + e.printStackTrace(); } } diff --git a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_shrinkingcone_full2.java b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_shrinkingcone_full2.java index e0fe728f52d..b085f74bf8c 100644 --- a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_shrinkingcone_full2.java +++ b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_shrinkingcone_full2.java @@ -28,9 +28,13 @@ import java.io.PrintWriter; import java.util.List; public class MySample_shrinkingcone_full2 { + // After running this, + // output sample csv and copy them into lts-exp/notebook/segmentResults/. + // output epsilonArray_*.txt and copy them into lts-exp/tools/. public static void main(String[] args) { String fileDir = "D:\\desktop\\NISTPV\\"; + // do not change the order of datasets below, as the output is used in exp bash String[] datasetNameList = new String[] {"WindSpeed", "Qloss", "Pyra1", "RTD"}; int[] noutList = new int[] { @@ -120,11 +124,25 @@ public class MySample_shrinkingcone_full2 { } } - for (int i = 0; i < epsilonArray.length; i++) { // 遍历行 - for (int j = 0; j < epsilonArray[i].length; j++) { // 遍历列 - System.out.print(epsilonArray[i][j] + ","); +// for (int i = 0; i < epsilonArray.length; i++) { // 遍历行 +// for (int j = 0; j < epsilonArray[i].length; j++) { // 遍历列 +// System.out.print(epsilonArray[i][j] + ","); +// } +// System.out.println(); +// } + + // do not change name of the output file, as the output is used in exp bash + try (FileWriter writer = new FileWriter("epsilonArray_sc.txt")) { + for (double[] row : epsilonArray) { + for (double element : row) { + writer.write(element + " "); + System.out.print(element + ","); + } + writer.write("\n"); + System.out.println(); } - System.out.println(); + } catch (IOException e) { + e.printStackTrace(); } } diff --git a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_simpiece_full2.java b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_simpiece_full2.java index e0bdd3aab25..d0cb0bd7278 100644 --- a/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_simpiece_full2.java +++ b/server/src/main/java/org/apache/iotdb/db/query/simpiece/MySample_simpiece_full2.java @@ -29,9 +29,13 @@ import java.util.Comparator; import java.util.List; public class MySample_simpiece_full2 { + // After running this, + // output sample csv and copy them into lts-exp/notebook/segmentResults/. + // output epsilonArray_*.txt and copy them into lts-exp/tools/. public static void main(String[] args) { String fileDir = "D:\\desktop\\NISTPV\\"; + // do not change the order of datasets below, as the output is used in exp bash String[] datasetNameList = new String[] {"WindSpeed", "Qloss", "Pyra1", "RTD"}; int[] noutList = new int[] { @@ -141,11 +145,25 @@ public class MySample_simpiece_full2 { } } - for (int i = 0; i < epsilonArray.length; i++) { // 遍历行 - for (int j = 0; j < epsilonArray[i].length; j++) { // 遍历列 - System.out.print(epsilonArray[i][j] + ","); +// for (int i = 0; i < epsilonArray.length; i++) { // 遍历行 +// for (int j = 0; j < epsilonArray[i].length; j++) { // 遍历列 +// System.out.print(epsilonArray[i][j] + ","); +// } +// System.out.println(); +// } + + // do not change name of the output file, as the output is used in exp bash + try (FileWriter writer = new FileWriter("epsilonArray_simpiece.txt")) { + for (double[] row : epsilonArray) { + for (double element : row) { + writer.write(element + " "); + System.out.print(element + ","); + } + writer.write("\n"); + System.out.println(); } - System.out.println(); + } catch (IOException e) { + e.printStackTrace(); } } diff --git a/server/src/test/java/org/apache/iotdb/db/integration/tri/MyTest_ILTS.java b/server/src/test/java/org/apache/iotdb/db/integration/tri/MyTest_ILTS.java index a8895c2457d..06a0268624c 100644 --- a/server/src/test/java/org/apache/iotdb/db/integration/tri/MyTest_ILTS.java +++ b/server/src/test/java/org/apache/iotdb/db/integration/tri/MyTest_ILTS.java @@ -259,7 +259,6 @@ public class MyTest_ILTS { @Test public void test2_2() { prepareData2(); - // https://github.com/LeiRui/iotdb/assets/33376433/bca2de97-47ba-40b9-9e41-353de7a6ab0e config.setNumIterations(1); // result equals LTTB String res = "-1.2079272[0],1.101946[200],-0.523204[300],0.145359[500],-1.014322[700],0.532565[900],"
