diff options
author | 2020-11-02 02:02:40 +0100 | |
---|---|---|
committer | 2020-11-02 02:02:40 +0100 | |
commit | f06427cd7375551582461f91b3458339a8227f9b (patch) | |
tree | 97bc6ec85f4c384e5080a6611b492caf460b6ce9 /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/SolutionCopier.xtend | |
parent | Must unit propagation (diff) | |
download | VIATRA-Generator-f06427cd7375551582461f91b3458339a8227f9b.tar.gz VIATRA-Generator-f06427cd7375551582461f91b3458339a8227f9b.tar.zst VIATRA-Generator-f06427cd7375551582461f91b3458339a8227f9b.zip |
Optimizing generator with linear objective functions
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/SolutionCopier.xtend')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/SolutionCopier.xtend | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/SolutionCopier.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/SolutionCopier.xtend index 38c8f5a1..33b69436 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/SolutionCopier.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner/src/hu/bme/mit/inf/dslreasoner/viatrasolver/reasoner/dse/SolutionCopier.xtend | |||
@@ -26,16 +26,12 @@ class CopiedSolution { | |||
26 | * using the supplied {@link NumericSolver}. | 26 | * using the supplied {@link NumericSolver}. |
27 | */ | 27 | */ |
28 | class SolutionCopier { | 28 | class SolutionCopier { |
29 | val NumericSolver numericSolver | ||
30 | val copiedSolutions = new LinkedHashMap<Object, CopiedSolution> | 29 | val copiedSolutions = new LinkedHashMap<Object, CopiedSolution> |
31 | 30 | ||
31 | @Accessors NumericSolver numericSolver | ||
32 | long startTime = System.nanoTime | 32 | long startTime = System.nanoTime |
33 | @Accessors(PUBLIC_GETTER) long totalCopierRuntime = 0 | 33 | @Accessors(PUBLIC_GETTER) long totalCopierRuntime = 0 |
34 | 34 | ||
35 | new(NumericSolver numericSolver) { | ||
36 | this.numericSolver = numericSolver | ||
37 | } | ||
38 | |||
39 | def void copySolution(ThreadContext context, Object solutionId) { | 35 | def void copySolution(ThreadContext context, Object solutionId) { |
40 | val existingCopy = copiedSolutions.get(solutionId) | 36 | val existingCopy = copiedSolutions.get(solutionId) |
41 | if (existingCopy === null) { | 37 | if (existingCopy === null) { |
@@ -47,7 +43,7 @@ class SolutionCopier { | |||
47 | totalCopierRuntime += System.nanoTime - copyStart | 43 | totalCopierRuntime += System.nanoTime - copyStart |
48 | val copierRuntime = System.nanoTime - startTime | 44 | val copierRuntime = System.nanoTime - startTime |
49 | val copiedSolution = new CopiedSolution(copiedPartialInterpretation, copier, copierRuntime) | 45 | val copiedSolution = new CopiedSolution(copiedPartialInterpretation, copier, copierRuntime) |
50 | numericSolver.fillSolutionCopy(copiedSolution.trace) | 46 | numericSolver?.fillSolutionCopy(copiedSolution.trace) |
51 | copiedSolutions.put(solutionId, copiedSolution) | 47 | copiedSolutions.put(solutionId, copiedSolution) |
52 | } else { | 48 | } else { |
53 | existingCopy.current = true | 49 | existingCopy.current = true |