Skip to content
Snippets Groups Projects
Commit 57344019 authored by Nikolaus Krismer's avatar Nikolaus Krismer
Browse files

fixed runtime calculation

parent f12f53d8
No related branches found
No related tags found
No related merge requests found
...@@ -43,12 +43,16 @@ public final class AlgorithmRuntimeTest { ...@@ -43,12 +43,16 @@ public final class AlgorithmRuntimeTest {
private static final Mode MODE = Mode.MULTIMODAL; private static final Mode MODE = Mode.MULTIMODAL;
private static final double WALKING_SPEED = 1.0; private static final double WALKING_SPEED = 1.0;
private static final int MAX_RUNTIME = 18000; // 5 hours; private static final int MAX_RUNTIME = 18000; // 5 hours;
private static final int RUNTIME_POINTS_PER_OFFSET = 12;
private static final int[] RUNTIME_OFFSETS = { private static final int[] RUNTIME_OFFSETS = {
60, // 1 minute (in sec) 60, // 1 minute (in sec)
3600, // 1 hour (in sec) 3600, // 1 hour (in sec)
86400 // 1 day (in sec) 86400 // 1 day (in sec)
}; };
private static final int[] RUNTIME_POINTS_PER_OFFSET = {
5, // every 5 minutes
2, // every 2 hours
1 // every day
};
private static Map<String, InitParams> initParamsMap; private static Map<String, InitParams> initParamsMap;
private static List<TestParameters> datsetParams = new ArrayList<>(); private static List<TestParameters> datsetParams = new ArrayList<>();
private static Map<String, Map<String, Long>> runtimes = new LinkedHashMap<>(); private static Map<String, Map<String, Long>> runtimes = new LinkedHashMap<>();
...@@ -172,10 +176,11 @@ public final class AlgorithmRuntimeTest { ...@@ -172,10 +176,11 @@ public final class AlgorithmRuntimeTest {
} }
times = new TreeSet<Integer>(); times = new TreeSet<Integer>();
for (int offset : RUNTIME_OFFSETS) { for (int i = 0; i < RUNTIME_OFFSETS.length; ++i) {
int stepWidth = (offset / RUNTIME_POINTS_PER_OFFSET); int offset = RUNTIME_OFFSETS[i];
for (int i = 0; i < offset; i += stepWidth) { int stepWidth = RUNTIME_POINTS_PER_OFFSET[i];
int runtime = Math.max(offset, offset * i); for (int j = 0; j < offset; j += stepWidth) {
int runtime = Math.max(offset, offset * j);
if (runtime > MAX_RUNTIME) { if (runtime > MAX_RUNTIME) {
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment