diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericSolver.xtend')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericSolver.xtend | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericSolver.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericSolver.xtend index 44964079..28edff41 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericSolver.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericSolver.xtend | |||
@@ -24,10 +24,12 @@ import java.util.List | |||
24 | import java.util.Map | 24 | import java.util.Map |
25 | import org.eclipse.emf.ecore.EObject | 25 | import org.eclipse.emf.ecore.EObject |
26 | import org.eclipse.viatra.dse.base.ThreadContext | 26 | import org.eclipse.viatra.dse.base.ThreadContext |
27 | import org.eclipse.viatra.dse.objectives.Fitness | ||
27 | import org.eclipse.viatra.query.runtime.api.IPatternMatch | 28 | import org.eclipse.viatra.query.runtime.api.IPatternMatch |
28 | import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher | 29 | import org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher |
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PConstraint | 30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PConstraint |
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation | 31 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation |
32 | import org.eclipse.viatra.dse.objectives.IObjective | ||
31 | 33 | ||
32 | class NumericSolver { | 34 | class NumericSolver { |
33 | val ModelGenerationMethod method | 35 | val ModelGenerationMethod method |
@@ -206,7 +208,6 @@ class NumericSolver { | |||
206 | } | 208 | } |
207 | } else { | 209 | } else { |
208 | if (needsFilling){ | 210 | if (needsFilling){ |
209 | //TODO ASSUME Always True | ||
210 | //GET LIST OF VARS TO FILL | 211 | //GET LIST OF VARS TO FILL |
211 | val fillMap = t.delegateGetSolution(dataObjects, propagatedConstraints, selectSolver(phase)) | 212 | val fillMap = t.delegateGetSolution(dataObjects, propagatedConstraints, selectSolver(phase)) |
212 | if (fillMap === null) finalResult = false | 213 | if (fillMap === null) finalResult = false |
@@ -225,7 +226,9 @@ class NumericSolver { | |||
225 | //STRATEGY | 226 | //STRATEGY |
226 | if (phase == 2) { | 227 | if (phase == 2) { |
227 | if (!finalResult) return finalResult | 228 | if (!finalResult) return finalResult |
228 | else finalResult = isSatisfiable(matches, 3) | 229 | else { |
230 | finalResult = isSatisfiable(matches, 3) | ||
231 | } | ||
229 | } | 232 | } |
230 | return finalResult | 233 | return finalResult |
231 | } | 234 | } |
@@ -243,6 +246,14 @@ class NumericSolver { | |||
243 | // -1 : take all numeric constraints | 246 | // -1 : take all numeric constraints |
244 | // -2 : SKIP (take no numeric constraints) | 247 | // -2 : SKIP (take no numeric constraints) |
245 | if (strategy == ExplorationStrategy.CrossingScenario) { | 248 | if (strategy == ExplorationStrategy.CrossingScenario) { |
249 | // //if has structural (non-WF) fitness issues, skip numeric handling | ||
250 | // val IObjective ob = threadContext.objectives.filter[it instanceof ModelGenerationCompositeObjective].get(0) | ||
251 | // val compo = ob as ModelGenerationCompositeObjective | ||
252 | // if (compo.getNonWFFitness(threadContext) > 0) { | ||
253 | // println("bootleg numeric-skip") | ||
254 | // return -2; | ||
255 | // } | ||
256 | |||
246 | //assumikng standard input, w/ visinBlocked and CollisionExists between pre-included actors | 257 | //assumikng standard input, w/ visinBlocked and CollisionExists between pre-included actors |
247 | val PartialInterpretation head = threadContext.getModel() as PartialInterpretation; | 258 | val PartialInterpretation head = threadContext.getModel() as PartialInterpretation; |
248 | val List<PartialRelationInterpretation> relations = head.getPartialrelationinterpretation(); | 259 | val List<PartialRelationInterpretation> relations = head.getPartialrelationinterpretation(); |