diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/BestFirstStrategyForModelGeneration.java | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/BestFirstStrategyForModelGeneration.java b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/BestFirstStrategyForModelGeneration.java index 63bd3b17..12533535 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/BestFirstStrategyForModelGeneration.java +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/BestFirstStrategyForModelGeneration.java | |||
@@ -11,9 +11,11 @@ package hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.dse; | |||
11 | 11 | ||
12 | import java.util.ArrayList; | 12 | import java.util.ArrayList; |
13 | import java.util.Arrays; | 13 | import java.util.Arrays; |
14 | import java.util.Collection; | ||
14 | import java.util.Collections; | 15 | import java.util.Collections; |
15 | import java.util.Comparator; | 16 | import java.util.Comparator; |
16 | import java.util.Iterator; | 17 | import java.util.Iterator; |
18 | import java.util.LinkedList; | ||
17 | import java.util.List; | 19 | import java.util.List; |
18 | import java.util.PriorityQueue; | 20 | import java.util.PriorityQueue; |
19 | import java.util.Random; | 21 | import java.util.Random; |
@@ -77,6 +79,7 @@ public class BestFirstStrategyForModelGeneration implements IStrategy { | |||
77 | private volatile boolean isInterrupted = false; | 79 | private volatile boolean isInterrupted = false; |
78 | private ModelResult modelResultByInternalSolver = null; | 80 | private ModelResult modelResultByInternalSolver = null; |
79 | private Random random = new Random(); | 81 | private Random random = new Random(); |
82 | private Collection<ViatraQueryMatcher<? extends IPatternMatch>> matchers; | ||
80 | 83 | ||
81 | // Statistics | 84 | // Statistics |
82 | private int numberOfStatecoderFail = 0; | 85 | private int numberOfStatecoderFail = 0; |
@@ -110,10 +113,12 @@ public class BestFirstStrategyForModelGeneration implements IStrategy { | |||
110 | 113 | ||
111 | ViatraQueryEngine engine = context.getQueryEngine(); | 114 | ViatraQueryEngine engine = context.getQueryEngine(); |
112 | // TODO: visualisation | 115 | // TODO: visualisation |
113 | // for(IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> p : this.method.getAllPatterns()) { | 116 | matchers = new LinkedList<ViatraQueryMatcher<? extends IPatternMatch>>(); |
114 | // ViatraQueryMatcher<? extends IPatternMatch> matcher = p.getMatcher(engine); | 117 | for(IQuerySpecification<? extends ViatraQueryMatcher<? extends IPatternMatch>> p : this.method.getAllPatterns()) { |
115 | // matcher.getAllMatches(); | 118 | System.out.println(p.getSimpleName()); |
116 | // } | 119 | ViatraQueryMatcher<? extends IPatternMatch> matcher = p.getMatcher(engine); |
120 | matchers.add(matcher); | ||
121 | } | ||
117 | 122 | ||
118 | this.solutionStoreWithCopy = new SolutionStoreWithCopy(); | 123 | this.solutionStoreWithCopy = new SolutionStoreWithCopy(); |
119 | this.solutionStoreWithDiversityDescriptor = new SolutionStoreWithDiversityDescriptor(configuration.diversityRequirement); | 124 | this.solutionStoreWithDiversityDescriptor = new SolutionStoreWithDiversityDescriptor(configuration.diversityRequirement); |
@@ -183,6 +188,10 @@ public class BestFirstStrategyForModelGeneration implements IStrategy { | |||
183 | context.executeAcitvationId(nextActivation); | 188 | context.executeAcitvationId(nextActivation); |
184 | 189 | ||
185 | visualiseCurrentState(); | 190 | visualiseCurrentState(); |
191 | for(ViatraQueryMatcher<? extends IPatternMatch> matcher : matchers) { | ||
192 | System.out.println(matcher.getPatternName() + " - " + matcher.countMatches()); | ||
193 | } | ||
194 | |||
186 | boolean consistencyCheckResult = checkConsistency(currentTrajectoryWithFittness); | 195 | boolean consistencyCheckResult = checkConsistency(currentTrajectoryWithFittness); |
187 | if(consistencyCheckResult == true) { continue mainLoop; } | 196 | if(consistencyCheckResult == true) { continue mainLoop; } |
188 | 197 | ||