diff options
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit')
-rw-r--r-- | Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/SolverLoader.xtend | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/SolverLoader.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/SolverLoader.xtend index da8ca0eb..045387a0 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/SolverLoader.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/SolverLoader.xtend | |||
@@ -1,5 +1,6 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.application.execution | 1 | package hu.bme.mit.inf.dslreasoner.application.execution |
2 | 2 | ||
3 | import hu.bme.mit.inf.dlsreasoner.alloy.reasoner.AlloyBackendSolver | ||
3 | import hu.bme.mit.inf.dlsreasoner.alloy.reasoner.AlloySolver | 4 | import hu.bme.mit.inf.dlsreasoner.alloy.reasoner.AlloySolver |
4 | import hu.bme.mit.inf.dlsreasoner.alloy.reasoner.AlloySolverConfiguration | 5 | import hu.bme.mit.inf.dlsreasoner.alloy.reasoner.AlloySolverConfiguration |
5 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.CostObjectiveFunction | 6 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.CostObjectiveFunction |
@@ -16,6 +17,8 @@ import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.ScopePro | |||
16 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.CostObjectiveConfiguration | 17 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.CostObjectiveConfiguration |
17 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.CostObjectiveElementConfiguration | 18 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.CostObjectiveElementConfiguration |
18 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.DiversityDescriptor | 19 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.DiversityDescriptor |
20 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ExplorationStrategy | ||
21 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.NumericSolverSelection | ||
19 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.PunishSizeStrategy | 22 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.PunishSizeStrategy |
20 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasoner | 23 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasoner |
21 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasonerConfiguration | 24 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasonerConfiguration |
@@ -28,9 +31,6 @@ import java.util.Optional | |||
28 | import org.eclipse.viatra.query.patternlanguage.emf.vql.PatternModel | 31 | import org.eclipse.viatra.query.patternlanguage.emf.vql.PatternModel |
29 | import org.eclipse.xtext.EcoreUtil2 | 32 | import org.eclipse.xtext.EcoreUtil2 |
30 | import org.eclipse.xtext.xbase.lib.Functions.Function1 | 33 | import org.eclipse.xtext.xbase.lib.Functions.Function1 |
31 | import hu.bme.mit.inf.dlsreasoner.alloy.reasoner.AlloyBackendSolver | ||
32 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.NumericSolverSelection | ||
33 | import java.util.HashMap | ||
34 | 34 | ||
35 | class SolverLoader { | 35 | class SolverLoader { |
36 | def loadSolver(Solver solver, Map<String, String> config) { | 36 | def loadSolver(Solver solver, Map<String, String> config) { |
@@ -171,6 +171,16 @@ class SolverLoader { | |||
171 | val stringValue = config.get("ignored-attributes") | 171 | val stringValue = config.get("ignored-attributes") |
172 | c.ignoredAttributesMap = parseIgnoredAttributes(stringValue) | 172 | c.ignoredAttributesMap = parseIgnoredAttributes(stringValue) |
173 | } | 173 | } |
174 | if (config.containsKey("strategy")) { | ||
175 | val stringValue = config.get("strategy") | ||
176 | c.strategy = switch (stringValue) { | ||
177 | case "none": ExplorationStrategy.None | ||
178 | case "crossingScenario": ExplorationStrategy.CrossingScenario | ||
179 | case "cs-hacker": ExplorationStrategy.CSHacker | ||
180 | default: throw new IllegalArgumentException("Unknown strategy: " + stringValue) | ||
181 | } | ||
182 | } | ||
183 | |||
174 | for (objectiveEntry : objectiveEntries) { | 184 | for (objectiveEntry : objectiveEntries) { |
175 | val costObjectiveConfig = new CostObjectiveConfiguration | 185 | val costObjectiveConfig = new CostObjectiveConfiguration |
176 | switch (objectiveEntry) { | 186 | switch (objectiveEntry) { |