diff options
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application')
-rw-r--r-- | Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/SolverLoader.xtend | 29 |
1 files changed, 27 insertions, 2 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 a9573fbf..bed0b3cf 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 | |||
@@ -7,13 +7,14 @@ import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.Solver | |||
7 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicSolverConfiguration | 7 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicSolverConfiguration |
8 | import hu.bme.mit.inf.dslreasoner.smt.reasoner.SMTSolver | 8 | import hu.bme.mit.inf.dslreasoner.smt.reasoner.SMTSolver |
9 | import hu.bme.mit.inf.dslreasoner.smt.reasoner.SmtSolverConfiguration | 9 | import hu.bme.mit.inf.dslreasoner.smt.reasoner.SmtSolverConfiguration |
10 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.DiversityDescriptor | ||
11 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.RealisticGuidance | ||
10 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasoner | 12 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasoner |
11 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasonerConfiguration | 13 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasonerConfiguration |
14 | import hu.bme.mit.inf.dslreasoner.visualisation.pi2graphviz.GraphvizVisualiser | ||
12 | import java.util.Map | 15 | import java.util.Map |
13 | import java.util.Optional | 16 | import java.util.Optional |
14 | import org.eclipse.xtext.xbase.lib.Functions.Function1 | 17 | import org.eclipse.xtext.xbase.lib.Functions.Function1 |
15 | import hu.bme.mit.inf.dslreasoner.visualisation.pi2graphviz.GraphvizVisualiser | ||
16 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.DiversityDescriptor | ||
17 | 18 | ||
18 | class SolverLoader { | 19 | class SolverLoader { |
19 | def loadSolver(Solver solver, Map<String, String> config) { | 20 | def loadSolver(Solver solver, Map<String, String> config) { |
@@ -86,6 +87,30 @@ class SolverLoader { | |||
86 | ] | 87 | ] |
87 | } catch (NumberFormatException e) {console.writeError('''Malformed number format: «e.message»''')} | 88 | } catch (NumberFormatException e) {console.writeError('''Malformed number format: «e.message»''')} |
88 | } | 89 | } |
90 | |||
91 | if(config.containsKey('realistic-guidance')){ | ||
92 | try{ | ||
93 | val stringValue = config.get('realistic-guidance'); | ||
94 | c.realisticGuidance = RealisticGuidance.valueOf(stringValue); | ||
95 | }catch(IllegalArgumentException e){ | ||
96 | console.writeError('''Illegal Guidance Name: «e.message»''') | ||
97 | } | ||
98 | } | ||
99 | |||
100 | if(config.containsKey('domain')){ | ||
101 | val stringValue = config.get('domain'); | ||
102 | c.domain = stringValue | ||
103 | } | ||
104 | |||
105 | if(config.containsKey('optional-wf')){ | ||
106 | val stringValue = config.get('optional-wf'); | ||
107 | c.isWFOptional = Boolean.parseBoolean(stringValue) | ||
108 | } | ||
109 | |||
110 | if(config.containsKey('allow-must-violations')){ | ||
111 | val stringValue = config.get('allow-must-violations'); | ||
112 | c.allowMustViolations = Boolean.parseBoolean(stringValue); | ||
113 | } | ||
89 | ] | 114 | ] |
90 | } else { | 115 | } else { |
91 | throw new UnsupportedOperationException('''Unknown solver: «solver»''') | 116 | throw new UnsupportedOperationException('''Unknown solver: «solver»''') |