diff options
author | 2019-08-01 01:00:12 +0200 | |
---|---|---|
committer | 2019-08-01 01:00:12 +0200 | |
commit | 7021a4d1f2805ebf3145cbc3893761d12f23361f (patch) | |
tree | b75c51136d3b593f94bf517a8552a1dbf8abdd2b /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend | |
parent | Build Cbc wrapper under Ubuntu 18.04 (diff) | |
download | VIATRA-Generator-7021a4d1f2805ebf3145cbc3893761d12f23361f.tar.gz VIATRA-Generator-7021a4d1f2805ebf3145cbc3893761d12f23361f.tar.zst VIATRA-Generator-7021a4d1f2805ebf3145cbc3893761d12f23361f.zip |
Configurability and better statistics for measurements
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/ViatraReasoner.xtend | 28 |
1 files changed, 24 insertions, 4 deletions
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 a8db5e43..1abde0a8 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 | |||
@@ -39,6 +39,7 @@ import org.eclipse.viatra.dse.api.DesignSpaceExplorer | |||
39 | import org.eclipse.viatra.dse.api.DesignSpaceExplorer.DseLoggingLevel | 39 | import org.eclipse.viatra.dse.api.DesignSpaceExplorer.DseLoggingLevel |
40 | import org.eclipse.viatra.dse.solutionstore.SolutionStore | 40 | import org.eclipse.viatra.dse.solutionstore.SolutionStore |
41 | import org.eclipse.viatra.dse.statecode.IStateCoderFactory | 41 | import org.eclipse.viatra.dse.statecode.IStateCoderFactory |
42 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.statecoder.NeighbourhoodBasedStateCoderFactory | ||
42 | 43 | ||
43 | class ViatraReasoner extends LogicReasoner { | 44 | class ViatraReasoner extends LogicReasoner { |
44 | val PartialInterpretationInitialiser initialiser = new PartialInterpretationInitialiser() | 45 | val PartialInterpretationInitialiser initialiser = new PartialInterpretationInitialiser() |
@@ -137,11 +138,14 @@ class ViatraReasoner extends LogicReasoner { | |||
137 | 138 | ||
138 | dse.setInitialModel(emptySolution, false) | 139 | dse.setInitialModel(emptySolution, false) |
139 | 140 | ||
140 | val IStateCoderFactory statecoder = if (viatraConfig.stateCoderStrategy == StateCoderStrategy.Neighbourhood) { | 141 | val IStateCoderFactory statecoder = switch (viatraConfig.stateCoderStrategy) { |
142 | case Neighbourhood: | ||
143 | new NeighbourhoodBasedStateCoderFactory | ||
144 | case PairwiseNeighbourhood: | ||
141 | new PairwiseNeighbourhoodBasedStateCoderFactory | 145 | new PairwiseNeighbourhoodBasedStateCoderFactory |
142 | } else { | 146 | default: |
143 | new IdentifierBasedStateCoderFactory | 147 | new IdentifierBasedStateCoderFactory |
144 | } | 148 | } |
145 | dse.stateCoderFactory = statecoder | 149 | dse.stateCoderFactory = statecoder |
146 | 150 | ||
147 | dse.maxNumberOfThreads = 1 | 151 | dse.maxNumberOfThreads = 1 |
@@ -184,8 +188,12 @@ class ViatraReasoner extends LogicReasoner { | |||
184 | it.value = (method.statistics.transformationExecutionTime / 1000000) as int | 188 | it.value = (method.statistics.transformationExecutionTime / 1000000) as int |
185 | ] | 189 | ] |
186 | it.entries += createIntStatisticEntry => [ | 190 | it.entries += createIntStatisticEntry => [ |
191 | it.name = "ScopePropagationTime" | ||
192 | it.value = (method.statistics.scopePropagationTime / 1000000) as int | ||
193 | ] | ||
194 | it.entries += createIntStatisticEntry => [ | ||
187 | it.name = "TypeAnalysisTime" | 195 | it.name = "TypeAnalysisTime" |
188 | it.value = (method.statistics.PreliminaryTypeAnalisisTime / 1000000) as int | 196 | it.value = (method.statistics.preliminaryTypeAnalisisTime / 1000000) as int |
189 | ] | 197 | ] |
190 | it.entries += createIntStatisticEntry => [ | 198 | it.entries += createIntStatisticEntry => [ |
191 | it.name = "StateCoderTime" | 199 | it.name = "StateCoderTime" |
@@ -199,6 +207,18 @@ class ViatraReasoner extends LogicReasoner { | |||
199 | it.name = "SolutionCopyTime" | 207 | it.name = "SolutionCopyTime" |
200 | it.value = (solutionCopier.getTotalCopierRuntime / 1000000) as int | 208 | it.value = (solutionCopier.getTotalCopierRuntime / 1000000) as int |
201 | ] | 209 | ] |
210 | it.entries += createIntStatisticEntry => [ | ||
211 | it.name = "States" | ||
212 | it.value = dse.numberOfStates as int | ||
213 | ] | ||
214 | it.entries += createIntStatisticEntry => [ | ||
215 | it.name = "Decisions" | ||
216 | it.value = method.statistics.decisionsTried | ||
217 | ] | ||
218 | it.entries += createIntStatisticEntry => [ | ||
219 | it.name = "ScopePropagations" | ||
220 | it.value = method.statistics.scopePropagatorInvocations | ||
221 | ] | ||
202 | if (diversityChecker.isActive) { | 222 | if (diversityChecker.isActive) { |
203 | it.entries += createIntStatisticEntry => [ | 223 | it.entries += createIntStatisticEntry => [ |
204 | it.name = "SolutionDiversityCheckTime" | 224 | it.name = "SolutionDiversityCheckTime" |