aboutsummaryrefslogtreecommitdiff
path: root/test/uk/ac/ox/cs/pagoda/tester/Statistics.java
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2022-05-10 18:17:06 +0100
committerFederico Igne <federico.igne@cs.ox.ac.uk>2022-05-11 12:34:47 +0100
commit17bd9beaf7f358a44e5bf36a5855fe6727d506dc (patch)
tree47e9310a0cff869d9ec017dcb2c81876407782c8 /test/uk/ac/ox/cs/pagoda/tester/Statistics.java
parent8651164cd632a5db310b457ce32d4fbc97bdc41c (diff)
downloadACQuA-17bd9beaf7f358a44e5bf36a5855fe6727d506dc.tar.gz
ACQuA-17bd9beaf7f358a44e5bf36a5855fe6727d506dc.zip
[pagoda] Move project to Scala
This commit includes a few changes: - The repository still uses Maven to manage dependency but it is now a Scala project. - The code has been ported from OWLAPI 3.4.10 to 5.1.20 - A proof of concept program using both RSAComb and PAGOdA has been added.
Diffstat (limited to 'test/uk/ac/ox/cs/pagoda/tester/Statistics.java')
-rw-r--r--test/uk/ac/ox/cs/pagoda/tester/Statistics.java60
1 files changed, 0 insertions, 60 deletions
diff --git a/test/uk/ac/ox/cs/pagoda/tester/Statistics.java b/test/uk/ac/ox/cs/pagoda/tester/Statistics.java
deleted file mode 100644
index 13d7f90..0000000
--- a/test/uk/ac/ox/cs/pagoda/tester/Statistics.java
+++ /dev/null
@@ -1,60 +0,0 @@
1package uk.ac.ox.cs.pagoda.tester;
2
3import java.io.File;
4import java.io.FileNotFoundException;
5import java.util.Iterator;
6import java.util.LinkedList;
7import java.util.Scanner;
8
9@Deprecated
10public class Statistics {
11
12 double satCheckTime;
13 double preprocessTime;
14 LinkedList<Integer> number = new LinkedList<Integer>();
15 LinkedList<Double> time = new LinkedList<Double>();
16
17 public Statistics(String file) {
18 Scanner scanner = null;
19 try {
20 scanner = new Scanner(new File(file));
21 for (String line; scanner.hasNextLine(); ) {
22 line = scanner.nextLine();
23 if (line.contains("time for satisfiability checking"))
24 satCheckTime = Double.parseDouble(line.substring(line.indexOf(": ") + 2));
25 else if (line.contains("Preprocessing Done in"))
26 preprocessTime = Double.parseDouble(line.substring(line.indexOf("in ") + 3, line.indexOf(" second")));
27 else if (line.contains("The number of answer tuples:"))
28 number.add(Integer.parseInt(line.substring(line.indexOf(": ") + 2)));
29 else if (line.contains("Total time to answer this query:"))
30 time.add(Double.parseDouble(line.substring(line.indexOf(": ") + 2)));
31 }
32 } catch (FileNotFoundException e) {
33 e.printStackTrace();
34 } finally {
35 if (scanner != null)
36 scanner.close();
37 }
38 }
39
40 public String diff(String other) {
41 return diff(new Statistics(other));
42 }
43
44 public String diff(Statistics other) {
45 if (other.number.size() != number.size())
46 return "The number of query is different! " + this.number.size() + " v.s. " + other.number.size();
47 int i = 0;
48 Iterator<Integer> iter1 = number.iterator(), iter2 = other.number.iterator();
49 StringBuilder diff = new StringBuilder();
50 int a, b;
51 while (iter1.hasNext()) {
52 ++i;
53 if ((a = iter1.next()) != (b = iter2.next())) {
54 diff.append("Query ").append(i).append(": ").append(a).append(", reference ").append(b).append("\n");
55 }
56 }
57 return diff.toString();
58 }
59
60}