diff options
author | Aren Babikian <aren.babikian@mail.mcgill.ca> | 2021-02-14 08:01:00 +0100 |
---|---|---|
committer | Aren Babikian <aren.babikian@mail.mcgill.ca> | 2021-02-14 08:01:00 +0100 |
commit | a8eb346fb97b54b6ee693da4840abd8be8b43843 (patch) | |
tree | 7f63b8432cd50150bff6509e3ff985a40b8763fb /Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericDynamicProblemSolver.java | |
parent | add cs scalability case study artifacts (diff) | |
download | VIATRA-Generator-a8eb346fb97b54b6ee693da4840abd8be8b43843.tar.gz VIATRA-Generator-a8eb346fb97b54b6ee693da4840abd8be8b43843.tar.zst VIATRA-Generator-a8eb346fb97b54b6ee693da4840abd8be8b43843.zip |
Add strategy flag + implement alost working crossingScenarioStrategy
Diffstat (limited to 'Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericDynamicProblemSolver.java')
-rw-r--r-- | Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericDynamicProblemSolver.java | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericDynamicProblemSolver.java b/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericDynamicProblemSolver.java new file mode 100644 index 00000000..bd4a10ff --- /dev/null +++ b/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericDynamicProblemSolver.java | |||
@@ -0,0 +1,41 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.viatra2logic; | ||
2 | |||
3 | import java.io.IOException; | ||
4 | import java.util.List; | ||
5 | import java.util.Map; | ||
6 | |||
7 | import org.eclipse.xtext.common.types.JvmIdentifiableElement; | ||
8 | import org.eclipse.xtext.xbase.XExpression; | ||
9 | |||
10 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PrimitiveElement; | ||
11 | |||
12 | public class NumericDynamicProblemSolver extends NumericProblemSolver{ | ||
13 | |||
14 | // private NumericZ3ProblemSolver z3Solver; | ||
15 | private NumericDrealProblemSolver drealSolver; | ||
16 | |||
17 | public NumericDynamicProblemSolver(String drealLocalPath) throws IOException, InterruptedException { | ||
18 | // this.z3Solver = new NumericZ3ProblemSolver(); | ||
19 | this.drealSolver = new NumericDrealProblemSolver(false, drealLocalPath); | ||
20 | } | ||
21 | |||
22 | public NumericProblemSolver selectSolver(String selection) { | ||
23 | switch (selection) { | ||
24 | case "z3": | ||
25 | return new NumericZ3ProblemSolver(); | ||
26 | case "dreal": | ||
27 | return this.drealSolver; | ||
28 | default: | ||
29 | throw new IllegalArgumentException("Unknown numeric solver selection: " + selection); | ||
30 | } | ||
31 | } | ||
32 | |||
33 | public boolean isSatisfiable(Map<XExpression, Iterable<Map<JvmIdentifiableElement, PrimitiveElement>>> matches) | ||
34 | throws Exception { | ||
35 | throw new Exception("Should not reach here - isSatisfiable"); | ||
36 | } | ||
37 | |||
38 | public Map<PrimitiveElement, Number> getOneSolution(List<PrimitiveElement> objs, | ||
39 | Map<XExpression, Iterable<Map<JvmIdentifiableElement, PrimitiveElement>>> matches) throws Exception { | ||
40 | throw new Exception("Should not reach here - getOneSolution"); | ||
41 | }} | ||