diff options
author | 2020-07-16 00:23:40 +0200 | |
---|---|---|
committer | 2020-07-16 00:23:40 +0200 | |
commit | 454dc3d1d54e943970db4c6794cca9acac272459 (patch) | |
tree | 92383a270300744e07900ee76ed41a1bccd4583d /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse | |
parent | Optimizations (diff) | |
download | VIATRA-Generator-454dc3d1d54e943970db4c6794cca9acac272459.tar.gz VIATRA-Generator-454dc3d1d54e943970db4c6794cca9acac272459.tar.zst VIATRA-Generator-454dc3d1d54e943970db4c6794cca9acac272459.zip |
Fix numeric-solver-at-end
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/ViatraReasonerSolutionSaver.xtend | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/ViatraReasonerSolutionSaver.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/ViatraReasonerSolutionSaver.xtend index d879d4cc..c0b5008c 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/ViatraReasonerSolutionSaver.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/ViatraReasonerSolutionSaver.xtend | |||
@@ -20,6 +20,7 @@ import org.eclipse.xtend.lib.annotations.Accessors | |||
20 | */ | 20 | */ |
21 | class ViatraReasonerSolutionSaver implements ISolutionSaver { | 21 | class ViatraReasonerSolutionSaver implements ISolutionSaver { |
22 | @Accessors val SolutionCopier solutionCopier | 22 | @Accessors val SolutionCopier solutionCopier |
23 | val NumericSolver numericSolver | ||
23 | @Accessors val DiversityChecker diversityChecker | 24 | @Accessors val DiversityChecker diversityChecker |
24 | val boolean hasExtremalObjectives | 25 | val boolean hasExtremalObjectives |
25 | val int numberOfRequiredSolutions | 26 | val int numberOfRequiredSolutions |
@@ -34,6 +35,7 @@ class ViatraReasonerSolutionSaver implements ISolutionSaver { | |||
34 | hasExtremalObjectives = leveledExtremalObjectives.exists[!empty] | 35 | hasExtremalObjectives = leveledExtremalObjectives.exists[!empty] |
35 | this.numberOfRequiredSolutions = numberOfRequiredSolutions | 36 | this.numberOfRequiredSolutions = numberOfRequiredSolutions |
36 | this.solutionCopier = new SolutionCopier(numericSolver) | 37 | this.solutionCopier = new SolutionCopier(numericSolver) |
38 | this.numericSolver = numericSolver | ||
37 | } | 39 | } |
38 | 40 | ||
39 | override saveSolution(ThreadContext context, Object id, SolutionTrajectory solutionTrajectory) { | 41 | override saveSolution(ThreadContext context, Object id, SolutionTrajectory solutionTrajectory) { |
@@ -97,7 +99,7 @@ class ViatraReasonerSolutionSaver implements ISolutionSaver { | |||
97 | } | 99 | } |
98 | 100 | ||
99 | private def shouldSaveSolution(Fitness fitness, ThreadContext context) { | 101 | private def shouldSaveSolution(Fitness fitness, ThreadContext context) { |
100 | return fitness.satisifiesHardObjectives | 102 | return fitness.satisifiesHardObjectives && numericSolver.currentSatisfiable |
101 | } | 103 | } |
102 | 104 | ||
103 | private def basicSaveSolution(ThreadContext context, Object id, SolutionTrajectory solutionTrajectory, | 105 | private def basicSaveSolution(ThreadContext context, Object id, SolutionTrajectory solutionTrajectory, |