diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder/NeighbourhoodBasedStateCoderFactory.xtend')
1 files changed, 4 insertions, 5 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder/NeighbourhoodBasedStateCoderFactory.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder/NeighbourhoodBasedStateCoderFactory.xtend index 5e442ca7..f19ac30f 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder/NeighbourhoodBasedStateCoderFactory.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder/NeighbourhoodBasedStateCoderFactory.xtend | |||
@@ -59,15 +59,14 @@ class NeighbourhoodBasedPartialInterpretationStateCoder<ModelRep, NodeRep> exten | |||
59 | override doCreateActivationCode(IPatternMatch match) { | 59 | override doCreateActivationCode(IPatternMatch match) { |
60 | val size = match.specification.parameters.size | 60 | val size = match.specification.parameters.size |
61 | val res = new ArrayList(size) | 61 | val res = new ArrayList(size) |
62 | var int index = 0 | ||
63 | var int equivalenceHash = 0 | 62 | var int equivalenceHash = 0 |
64 | val prime = 31 | 63 | val prime = 31 |
65 | 64 | ||
66 | while (index < size) { | 65 | for (var int index = 0; index < size; index++) { |
67 | res.add(getCode(match.get(index))) | 66 | val matchArgument = match.get(index) |
68 | index++ | 67 | res.add(getCode(matchArgument)) |
69 | for (var i = 0; i < index; i++) { | 68 | for (var i = 0; i < index; i++) { |
70 | val number = if (match.get(index) === match.get(i)) { | 69 | val number = if (matchArgument === match.get(i)) { |
71 | 1 | 70 | 1 |
72 | } else { | 71 | } else { |
73 | 0 | 72 | 0 |