diff options
author | Kristóf Marussy <kris7topher@gmail.com> | 2019-04-07 13:46:36 +0200 |
---|---|---|
committer | Kristóf Marussy <kris7topher@gmail.com> | 2019-04-07 13:46:36 +0200 |
commit | 3f9b1c92cc35fa4ed9672a2b8601f4c22af24921 (patch) | |
tree | 927c41492ff3b50b3d998a4fbe87861187d85912 /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/SolutionStoreWithCopy.xtend | |
parent | Add reliability probability and mtff objectives (diff) | |
download | VIATRA-Generator-3f9b1c92cc35fa4ed9672a2b8601f4c22af24921.tar.gz VIATRA-Generator-3f9b1c92cc35fa4ed9672a2b8601f4c22af24921.tar.zst VIATRA-Generator-3f9b1c92cc35fa4ed9672a2b8601f4c22af24921.zip |
Infrastructure for objective functions
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/SolutionStoreWithCopy.xtend')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/SolutionStoreWithCopy.xtend | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/SolutionStoreWithCopy.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/SolutionStoreWithCopy.xtend deleted file mode 100644 index a8b7301e..00000000 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/SolutionStoreWithCopy.xtend +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.dse | ||
2 | |||
3 | import java.util.List | ||
4 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation | ||
5 | import java.util.LinkedList | ||
6 | import org.eclipse.emf.ecore.EObject | ||
7 | import java.util.Map | ||
8 | import org.eclipse.emf.ecore.util.EcoreUtil | ||
9 | import org.eclipse.viatra.dse.base.ThreadContext | ||
10 | import java.util.TreeMap | ||
11 | import java.util.SortedMap | ||
12 | |||
13 | class SolutionStoreWithCopy { | ||
14 | |||
15 | long runtime = 0 | ||
16 | List<PartialInterpretation> solutions = new LinkedList | ||
17 | //public List<SortedMap<String,Integer>> additionalMatches = new LinkedList | ||
18 | List<Map<EObject,EObject>> copyTraces = new LinkedList | ||
19 | |||
20 | long sartTime = System.nanoTime | ||
21 | List<Long> solutionTimes = new LinkedList | ||
22 | |||
23 | /*def newSolution(ThreadContext context, SortedMap<String,Integer> additonalMatch) { | ||
24 | additionalMatches+= additonalMatch | ||
25 | newSolution(context) | ||
26 | }*/ | ||
27 | |||
28 | def newSolution(ThreadContext context) { | ||
29 | //print(System.nanoTime-initTime + ";") | ||
30 | val copyStart = System.nanoTime | ||
31 | val solution = context.model as PartialInterpretation | ||
32 | val copier = new EcoreUtil.Copier | ||
33 | val solutionCopy = copier.copy(solution) as PartialInterpretation | ||
34 | copier.copyReferences | ||
35 | solutions.add(solutionCopy) | ||
36 | copyTraces.add(copier) | ||
37 | runtime += System.nanoTime - copyStart | ||
38 | solutionTimes.add(System.nanoTime-sartTime) | ||
39 | } | ||
40 | def getSumRuntime() { | ||
41 | return runtime | ||
42 | } | ||
43 | def getAllRuntimes() { | ||
44 | return solutionTimes | ||
45 | } | ||
46 | def getSolutions() { | ||
47 | solutions | ||
48 | } | ||
49 | def getCopyTraces() { | ||
50 | return copyTraces | ||
51 | } | ||
52 | } \ No newline at end of file | ||