diff options
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner')
-rw-r--r-- | Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/SolverLoader.xtend | 11 |
1 files changed, 11 insertions, 0 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 2f64fc76..e6f42709 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 | |||
@@ -13,6 +13,7 @@ import java.util.Map | |||
13 | import java.util.Optional | 13 | import java.util.Optional |
14 | import org.eclipse.xtext.xbase.lib.Functions.Function1 | 14 | import org.eclipse.xtext.xbase.lib.Functions.Function1 |
15 | import hu.bme.mit.inf.dslreasoner.visualisation.pi2graphviz.GraphvizVisualiser | 15 | import hu.bme.mit.inf.dslreasoner.visualisation.pi2graphviz.GraphvizVisualiser |
16 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.DiversityDescriptor | ||
16 | 17 | ||
17 | class SolverLoader { | 18 | class SolverLoader { |
18 | def loadSolver(Solver solver, Map<String, String> config) { | 19 | def loadSolver(Solver solver, Map<String, String> config) { |
@@ -75,6 +76,16 @@ class SolverLoader { | |||
75 | } else if(solver === Solver::VIATRA_SOLVER) { | 76 | } else if(solver === Solver::VIATRA_SOLVER) { |
76 | return new ViatraReasonerConfiguration => [c| | 77 | return new ViatraReasonerConfiguration => [c| |
77 | c.debugCongiguration.partialInterpretatioVisualiser = new GraphvizVisualiser | 78 | c.debugCongiguration.partialInterpretatioVisualiser = new GraphvizVisualiser |
79 | if(config.containsKey("diversity-range")) { | ||
80 | val stringValue = config.get("diversity-range") | ||
81 | try{ | ||
82 | val range = Integer.parseInt(stringValue) | ||
83 | c.diversityRequirement = new DiversityDescriptor => [ | ||
84 | it.ensureDiversity = true | ||
85 | it.range = range | ||
86 | ] | ||
87 | } catch (NumberFormatException e) {console.writeError('''Malformed number format: «e.message»''')} | ||
88 | } | ||
78 | ] | 89 | ] |
79 | } else { | 90 | } else { |
80 | throw new UnsupportedOperationException('''Unknown solver: «solver»''') | 91 | throw new UnsupportedOperationException('''Unknown solver: «solver»''') |