diff options
author | 2021-07-30 10:04:27 +0200 | |
---|---|---|
committer | 2021-07-30 10:04:27 +0200 | |
commit | aaa67b0ef8840d97b062a4f1383bf93410984af3 (patch) | |
tree | 2c07208bb6b5ab27b47bd477dfbcc6e77b50d623 /Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericProblemSolver.java | |
parent | Config updated and createSharedVersionedMapStores service (diff) | |
download | VIATRA-Generator-V4transformation.tar.gz VIATRA-Generator-V4transformation.tar.zst VIATRA-Generator-V4transformation.zip |
Numeric solver dreal hardcoding -> configV4transformation
Diffstat (limited to 'Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericProblemSolver.java')
-rw-r--r-- | Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericProblemSolver.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericProblemSolver.java b/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericProblemSolver.java index 5e823d9d..8f57e40c 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericProblemSolver.java +++ b/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericProblemSolver.java | |||
@@ -35,6 +35,24 @@ public abstract class NumericProblemSolver { | |||
35 | public long getEndSolvingProblem() {return endSolvingProblem;} | 35 | public long getEndSolvingProblem() {return endSolvingProblem;} |
36 | public long getEndFormingSolution() {return endFormingSolution;} | 36 | public long getEndFormingSolution() {return endFormingSolution;} |
37 | 37 | ||
38 | public abstract boolean isSatisfiable(Map<XExpression, Iterable<Map<JvmIdentifiableElement,PrimitiveElement>>> matches) throws Exception; | 38 | public boolean isSatisfiable(Map<XExpression, Iterable<Map<JvmIdentifiableElement,PrimitiveElement>>> matches) throws Exception { |
39 | public abstract Map<PrimitiveElement,Number> getOneSolution(List<PrimitiveElement> objs, Map<XExpression, Iterable<Map<JvmIdentifiableElement,PrimitiveElement>>> matches) throws Exception; | 39 | if(!initialized) { |
40 | this.initialize(); | ||
41 | this.initialized=true; | ||
42 | } | ||
43 | return this.internalIsSatisfiable(matches); | ||
44 | } | ||
45 | public Map<PrimitiveElement,Number> getOneSolution(List<PrimitiveElement> objs, Map<XExpression, Iterable<Map<JvmIdentifiableElement,PrimitiveElement>>> matches) throws Exception{ | ||
46 | if(!initialized) { | ||
47 | this.initialize(); | ||
48 | this.initialized=true; | ||
49 | } | ||
50 | return this.internalGetOneSolution(objs, matches); | ||
51 | } | ||
52 | |||
53 | boolean initialized = false; | ||
54 | protected abstract void initialize(); | ||
55 | |||
56 | protected abstract boolean internalIsSatisfiable(Map<XExpression, Iterable<Map<JvmIdentifiableElement,PrimitiveElement>>> matches) throws Exception; | ||
57 | protected abstract Map<PrimitiveElement,Number> internalGetOneSolution(List<PrimitiveElement> objs, Map<XExpression, Iterable<Map<JvmIdentifiableElement,PrimitiveElement>>> matches) throws Exception; | ||
40 | } | 58 | } |