diff options
3 files changed, 29 insertions, 1 deletions
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericTranslator.xtend b/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericTranslator.xtend index 89719b91..81bc1796 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericTranslator.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.viatra2logic/src/hu/bme/mit/inf/dslreasoner/viatra2logic/NumericTranslator.xtend | |||
@@ -19,6 +19,10 @@ class NumericTranslator { | |||
19 | 19 | ||
20 | private XExpressionExtractor extractor = new XExpressionExtractor(); | 20 | private XExpressionExtractor extractor = new XExpressionExtractor(); |
21 | 21 | ||
22 | long formingProblemTime=0; | ||
23 | long solvingProblemTime=0; | ||
24 | long formingSolutionTime=0; | ||
25 | |||
22 | val comparator = new Comparator<JvmIdentifiableElement>(){ | 26 | val comparator = new Comparator<JvmIdentifiableElement>(){ |
23 | override compare(JvmIdentifiableElement o1, JvmIdentifiableElement o2) { | 27 | override compare(JvmIdentifiableElement o1, JvmIdentifiableElement o2) { |
24 | //println('''«o1.simpleName» - «o2.simpleName»''') | 28 | //println('''«o1.simpleName» - «o2.simpleName»''') |
@@ -52,6 +56,7 @@ class NumericTranslator { | |||
52 | val input = formNumericProblemInstance(matches) | 56 | val input = formNumericProblemInstance(matches) |
53 | val solver = new NumericProblemSolver | 57 | val solver = new NumericProblemSolver |
54 | val satisfiability = solver.isSatisfiable(input) | 58 | val satisfiability = solver.isSatisfiable(input) |
59 | solver.updateTimes | ||
55 | return satisfiability | 60 | return satisfiability |
56 | } | 61 | } |
57 | 62 | ||
@@ -59,6 +64,17 @@ class NumericTranslator { | |||
59 | val input = formNumericProblemInstance(matches) | 64 | val input = formNumericProblemInstance(matches) |
60 | val solver = new NumericProblemSolver | 65 | val solver = new NumericProblemSolver |
61 | val solution = solver.getOneSolution(primitiveElements,input) | 66 | val solution = solver.getOneSolution(primitiveElements,input) |
67 | solver.updateTimes | ||
62 | return solution | 68 | return solution |
63 | } | 69 | } |
70 | |||
71 | private def updateTimes(NumericProblemSolver s) { | ||
72 | this.formingProblemTime += s.getEndformingProblem | ||
73 | this.solvingProblemTime += s.getEndSolvingProblem | ||
74 | this.formingSolutionTime += s.getEndFormingSolution | ||
75 | } | ||
76 | |||
77 | def getFormingProblemTime() {formingProblemTime} | ||
78 | def getSolvingProblemTime() {solvingProblemTime} | ||
79 | def getFormingSolutionTime() {formingSolutionTime} | ||
64 | } \ No newline at end of file | 80 | } \ No newline at end of file |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend index bafe78f6..293df935 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend | |||
@@ -159,7 +159,16 @@ class ViatraReasoner extends LogicReasoner{ | |||
159 | it.name = "ActivationSelectionTime" it.value = (strategy.activationSelector.runtime/1000000) as int | 159 | it.name = "ActivationSelectionTime" it.value = (strategy.activationSelector.runtime/1000000) as int |
160 | ] | 160 | ] |
161 | it.entries += createIntStatisticEntry => [ | 161 | it.entries += createIntStatisticEntry => [ |
162 | it.name = "NumericalSolverTime" it.value = (strategy.numericSolver.runtime/1000000) as int | 162 | it.name = "NumericalSolverSumTime" it.value = (strategy.numericSolver.runtime/1000000) as int |
163 | ] | ||
164 | it.entries += createIntStatisticEntry => [ | ||
165 | it.name = "NumericalSolverProblemFormingTime" it.value = (strategy.numericSolver.solverFormingProblem/1000000) as int | ||
166 | ] | ||
167 | it.entries += createIntStatisticEntry => [ | ||
168 | it.name = "NumericalSolverSolvingTime" it.value = (strategy.numericSolver.solverSolvingProblem/1000000) as int | ||
169 | ] | ||
170 | it.entries += createIntStatisticEntry => [ | ||
171 | it.name = "NumericalSolverInterpretingSolution" it.value = (strategy.numericSolver.solverSolution/1000000) as int | ||
163 | ] | 172 | ] |
164 | it.entries += createIntStatisticEntry => [ | 173 | it.entries += createIntStatisticEntry => [ |
165 | it.name = "NumericalSolverCachingTime" it.value = (strategy.numericSolver.cachingTime/1000000) as int | 174 | it.name = "NumericalSolverCachingTime" it.value = (strategy.numericSolver.cachingTime/1000000) as int |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericSolver.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericSolver.xtend index 9da97d30..0fb5d702 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericSolver.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/NumericSolver.xtend | |||
@@ -56,6 +56,9 @@ class NumericSolver { | |||
56 | def getCachingTime(){cachingTime} | 56 | def getCachingTime(){cachingTime} |
57 | def getNumberOfSolverCalls(){numberOfSolverCalls} | 57 | def getNumberOfSolverCalls(){numberOfSolverCalls} |
58 | def getNumberOfCachedSolverCalls(){numberOfCachedSolverCalls} | 58 | def getNumberOfCachedSolverCalls(){numberOfCachedSolverCalls} |
59 | def getSolverFormingProblem(){this.t.formingProblemTime} | ||
60 | def getSolverSolvingProblem(){this.t.solvingProblemTime} | ||
61 | def getSolverSolution(){this.t.formingSolutionTime} | ||
59 | 62 | ||
60 | def boolean maySatisfiable() { | 63 | def boolean maySatisfiable() { |
61 | isSatisfiable(this.constraint2MustUnitPropagationPrecondition) | 64 | isSatisfiable(this.constraint2MustUnitPropagationPrecondition) |