diff options
author | Oszkar Semerath <semerath@mit.bme.hu> | 2020-05-11 02:22:15 +0200 |
---|---|---|
committer | Oszkar Semerath <semerath@mit.bme.hu> | 2020-05-11 02:22:15 +0200 |
commit | 91b772506f00ce2e317027dd384b82dc7a1295fd (patch) | |
tree | 19fd1b945cae52a4b32357f48ee2da3aa7ca1d5b /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/BestFirstStrategyForModelGeneration.java | |
parent | automated containment and attribute addition for subclasses (diff) | |
download | VIATRA-Generator-91b772506f00ce2e317027dd384b82dc7a1295fd.tar.gz VIATRA-Generator-91b772506f00ce2e317027dd384b82dc7a1295fd.tar.zst VIATRA-Generator-91b772506f00ce2e317027dd384b82dc7a1295fd.zip |
separated must and current UP rules to support non-prop neg finds
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/BestFirstStrategyForModelGeneration.java')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/BestFirstStrategyForModelGeneration.java | 18 |
1 files changed, 10 insertions, 8 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 18fe94e4..45dffe7c 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 | |||
@@ -147,7 +147,7 @@ public class BestFirstStrategyForModelGeneration implements IStrategy { | |||
147 | if (!context.checkGlobalConstraints()) { | 147 | if (!context.checkGlobalConstraints()) { |
148 | logger.info("Global contraint is not satisifed in the first state. Terminate."); | 148 | logger.info("Global contraint is not satisifed in the first state. Terminate."); |
149 | return; | 149 | return; |
150 | } else if(!numericSolver.isSatisfiable()) { | 150 | } else if(!numericSolver.maySatisfiable()) { |
151 | logger.info("Numeric contraints are not satisifed in the first state. Terminate."); | 151 | logger.info("Numeric contraints are not satisifed in the first state. Terminate."); |
152 | return; | 152 | return; |
153 | } | 153 | } |
@@ -228,7 +228,7 @@ public class BestFirstStrategyForModelGeneration implements IStrategy { | |||
228 | } else if (!context.checkGlobalConstraints()) { | 228 | } else if (!context.checkGlobalConstraints()) { |
229 | logger.debug("Global contraint is not satisifed."); | 229 | logger.debug("Global contraint is not satisifed."); |
230 | context.backtrack(); | 230 | context.backtrack(); |
231 | } else if (!numericSolver.isSatisfiable()) { | 231 | } else if (!numericSolver.maySatisfiable()) { |
232 | logger.debug("Numeric constraints are not satisifed."); | 232 | logger.debug("Numeric constraints are not satisifed."); |
233 | context.backtrack(); | 233 | context.backtrack(); |
234 | } else { | 234 | } else { |
@@ -284,13 +284,15 @@ public class BestFirstStrategyForModelGeneration implements IStrategy { | |||
284 | private void checkForSolution(final Fitness fittness) { | 284 | private void checkForSolution(final Fitness fittness) { |
285 | if (fittness.isSatisifiesHardObjectives()) { | 285 | if (fittness.isSatisifiesHardObjectives()) { |
286 | if (solutionStoreWithDiversityDescriptor.isDifferent(context)) { | 286 | if (solutionStoreWithDiversityDescriptor.isDifferent(context)) { |
287 | Map<EObject, EObject> trace = solutionStoreWithCopy.newSolution(context); | 287 | if(numericSolver.currentSatisfiable()) { |
288 | numericSolver.fillSolutionCopy(trace); | 288 | Map<EObject, EObject> trace = solutionStoreWithCopy.newSolution(context); |
289 | solutionStoreWithDiversityDescriptor.newSolution(context); | 289 | numericSolver.fillSolutionCopy(trace); |
290 | solutionStore.newSolution(context); | 290 | solutionStoreWithDiversityDescriptor.newSolution(context); |
291 | configuration.progressMonitor.workedModelFound(configuration.solutionScope.numberOfRequiredSolution); | 291 | solutionStore.newSolution(context); |
292 | configuration.progressMonitor.workedModelFound(configuration.solutionScope.numberOfRequiredSolution); | ||
292 | 293 | ||
293 | logger.debug("Found a solution."); | 294 | logger.debug("Found a solution."); |
295 | } | ||
294 | } | 296 | } |
295 | } | 297 | } |
296 | } | 298 | } |