aboutsummaryrefslogtreecommitdiff
path: root/src/uk/ac/ox/cs/pagoda/endomorph/plan
diff options
context:
space:
mode:
authorRncLsn <rnc.lsn@gmail.com>2015-05-28 19:14:03 +0100
committerRncLsn <rnc.lsn@gmail.com>2015-05-28 19:14:03 +0100
commitb8212705e65db860bbb899b16fa0e7bc9e8536cf (patch)
tree7343b7349904717a4b99840f44e802e401650044 /src/uk/ac/ox/cs/pagoda/endomorph/plan
parent1055e67727b1aca80ae7ffaceabce3aacb00b6d2 (diff)
downloadACQuA-b8212705e65db860bbb899b16fa0e7bc9e8536cf.tar.gz
ACQuA-b8212705e65db860bbb899b16fa0e7bc9e8536cf.zip
Bug-fix in tester.
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/endomorph/plan')
-rw-r--r--src/uk/ac/ox/cs/pagoda/endomorph/plan/OpenEndPlan.java27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/endomorph/plan/OpenEndPlan.java b/src/uk/ac/ox/cs/pagoda/endomorph/plan/OpenEndPlan.java
index a740833..4022c1d 100644
--- a/src/uk/ac/ox/cs/pagoda/endomorph/plan/OpenEndPlan.java
+++ b/src/uk/ac/ox/cs/pagoda/endomorph/plan/OpenEndPlan.java
@@ -1,12 +1,7 @@
1package uk.ac.ox.cs.pagoda.endomorph.plan; 1package uk.ac.ox.cs.pagoda.endomorph.plan;
2 2
3import java.util.Collection; 3import uk.ac.ox.cs.pagoda.endomorph.Clique;
4import java.util.HashSet; 4import uk.ac.ox.cs.pagoda.endomorph.DependencyGraph;
5import java.util.LinkedList;
6import java.util.Map;
7import java.util.Set;
8
9import uk.ac.ox.cs.pagoda.endomorph.*;
10import uk.ac.ox.cs.pagoda.query.AnswerTuple; 5import uk.ac.ox.cs.pagoda.query.AnswerTuple;
11import uk.ac.ox.cs.pagoda.query.QueryRecord; 6import uk.ac.ox.cs.pagoda.query.QueryRecord;
12import uk.ac.ox.cs.pagoda.query.QueryRecord.Step; 7import uk.ac.ox.cs.pagoda.query.QueryRecord.Step;
@@ -15,6 +10,8 @@ import uk.ac.ox.cs.pagoda.summary.NodeTuple;
15import uk.ac.ox.cs.pagoda.util.Timer; 10import uk.ac.ox.cs.pagoda.util.Timer;
16import uk.ac.ox.cs.pagoda.util.Utility; 11import uk.ac.ox.cs.pagoda.util.Utility;
17 12
13import java.util.*;
14
18public class OpenEndPlan implements CheckPlan { 15public class OpenEndPlan implements CheckPlan {
19 16
20 public static final int TIME_OUT_MIN = 1; 17 public static final int TIME_OUT_MIN = 1;
@@ -23,18 +20,16 @@ public class OpenEndPlan implements CheckPlan {
23 DependencyGraph dGraph; 20 DependencyGraph dGraph;
24 QueryRecord m_record; 21 QueryRecord m_record;
25 int m_answerArity; 22 int m_answerArity;
26 23 Set<Clique> validated = new HashSet<Clique>();
24 Set<Clique> falsified = new HashSet<Clique>();
25 Set<AnswerTuple> passedAnswers = new HashSet<AnswerTuple>();
27 public OpenEndPlan(Checker checker, DependencyGraph dGraph, QueryRecord record) { 26 public OpenEndPlan(Checker checker, DependencyGraph dGraph, QueryRecord record) {
28 this.checker = checker; 27 this.checker = checker;
29 this.dGraph = dGraph; 28 this.dGraph = dGraph;
30 m_record = record; 29 m_record = record;
31 m_answerArity = record.getAnswerVariables().length; 30 m_answerArity = record.getAnswerVariables().length;
32 } 31 }
33 32
34 Set<Clique> validated = new HashSet<Clique>();
35 Set<Clique> falsified = new HashSet<Clique>();
36 Set<AnswerTuple> passedAnswers = new HashSet<AnswerTuple>();
37
38 @Override 33 @Override
39 public int check() { 34 public int check() {
40 LinkedList<Clique> topo = new LinkedList<Clique>(dGraph.getTopologicalOrder()); 35 LinkedList<Clique> topo = new LinkedList<Clique>(dGraph.getTopologicalOrder());
@@ -93,20 +88,20 @@ public class OpenEndPlan implements CheckPlan {
93 } 88 }
94 89
95 m_record.addLowerBoundAnswers(validAnswers); 90 m_record.addLowerBoundAnswers(validAnswers);
96 m_record.addProcessingTime(Step.FullReasoning, t.duration()); 91 m_record.addProcessingTime(Step.FULL_REASONING, t.duration());
97 return count; 92 return count;
98 } 93 }
99 94
100 private boolean redundant(Clique clique) { 95 private boolean redundant(Clique clique) {
101 for (NodeTuple nodeTuple: clique.getNodeTuples()) 96 for (NodeTuple nodeTuple: clique.getNodeTuples())
102 if (!passedAnswers.contains(AnswerTuple.create(nodeTuple.getAnswerTuple(), m_answerArity))) 97 if (!passedAnswers.contains(AnswerTuple.getInstance(nodeTuple.getAnswerTuple(), m_answerArity)))
103 return false; 98 return false;
104 return true; 99 return true;
105 } 100 }
106 101
107 private void addProjections(Clique clique) { 102 private void addProjections(Clique clique) {
108 for (NodeTuple nodeTuple: clique.getNodeTuples()) 103 for (NodeTuple nodeTuple: clique.getNodeTuples())
109 passedAnswers.add(AnswerTuple.create(nodeTuple.getAnswerTuple(), m_answerArity)); 104 passedAnswers.add(AnswerTuple.getInstance(nodeTuple.getAnswerTuple(), m_answerArity));
110 } 105 }
111 106
112 private void setMarkCascadelyValidated(Clique clique) { 107 private void setMarkCascadelyValidated(Clique clique) {