diff options
author | 2018-08-28 14:21:57 +0200 | |
---|---|---|
committer | 2018-08-28 14:21:57 +0200 | |
commit | 7b5bc7ef4c842b1f365b53b526e78083bb85a9c3 (patch) | |
tree | 41647dabc7ebe7e1e42fefcf964b665b312ce787 /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner | |
parent | Fix SolutionStoreWithDiversityDescriptor (diff) | |
download | VIATRA-Generator-7b5bc7ef4c842b1f365b53b526e78083bb85a9c3.tar.gz VIATRA-Generator-7b5bc7ef4c842b1f365b53b526e78083bb85a9c3.tar.zst VIATRA-Generator-7b5bc7ef4c842b1f365b53b526e78083bb85a9c3.zip |
Add patterns to shape
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner')
3 files changed, 48 insertions, 30 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/Descriptor.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/Descriptor.xtend index 2e8f61a9..f9cf2986 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/Descriptor.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/Descriptor.xtend | |||
@@ -5,6 +5,7 @@ import java.util.Map | |||
5 | import java.util.Set | 5 | import java.util.Set |
6 | import org.eclipse.xtend.lib.annotations.Data | 6 | import org.eclipse.xtend.lib.annotations.Data |
7 | import java.util.List | 7 | import java.util.List |
8 | import java.util.HashSet | ||
8 | 9 | ||
9 | @Data abstract class AbstractNodeDescriptor { | 10 | @Data abstract class AbstractNodeDescriptor { |
10 | long dataHash | 11 | long dataHash |
@@ -25,10 +26,11 @@ import java.util.List | |||
25 | // } | 26 | // } |
26 | } | 27 | } |
27 | 28 | ||
28 | //TODO: Modify for patterns | 29 | |
29 | @Data class LocalNodeDescriptor extends AbstractNodeDescriptor{ | 30 | @Data class LocalNodeDescriptor extends AbstractNodeDescriptor{ |
30 | Set<String> types | 31 | Set<String> types |
31 | String id; | 32 | String id; |
33 | |||
32 | new(String id, Set<String> types) { | 34 | new(String id, Set<String> types) { |
33 | super(calcualteDataHash(id,types)) | 35 | super(calcualteDataHash(id,types)) |
34 | this.types = types | 36 | this.types = types |
@@ -89,8 +91,6 @@ import java.util.List | |||
89 | // } | 91 | // } |
90 | } | 92 | } |
91 | 93 | ||
92 | //TODO: PatternRelation | ||
93 | |||
94 | @Data class PatternRelation<NODESHAPE> { | 94 | @Data class PatternRelation<NODESHAPE> { |
95 | String patternName | 95 | String patternName |
96 | int param | 96 | int param |
@@ -107,28 +107,31 @@ import java.util.List | |||
107 | String type | 107 | String type |
108 | } | 108 | } |
109 | 109 | ||
110 | //TODO: Modify for hypergraphs | ||
111 | @Data class FurtherNodeDescriptor<NodeRep> extends AbstractNodeDescriptor{ | 110 | @Data class FurtherNodeDescriptor<NodeRep> extends AbstractNodeDescriptor{ |
112 | 111 | ||
113 | NodeRep previousRepresentation | 112 | NodeRep previousRepresentation |
114 | Map<IncomingRelation<NodeRep>,Integer> incomingEdges | 113 | Map<IncomingRelation<NodeRep>,Integer> incomingEdges |
115 | Map<OutgoingRelation<NodeRep>,Integer> outgoingEdges | 114 | Map<OutgoingRelation<NodeRep>,Integer> outgoingEdges |
115 | Set<PatternRelation<NodeRep>> patterns | ||
116 | 116 | ||
117 | new( | 117 | new( |
118 | NodeRep previousRepresentation, | 118 | NodeRep previousRepresentation, |
119 | Map<IncomingRelation<NodeRep>,Integer> incomingEdges, | 119 | Map<IncomingRelation<NodeRep>,Integer> incomingEdges, |
120 | Map<OutgoingRelation<NodeRep>,Integer> outgoingEdges) | 120 | Map<OutgoingRelation<NodeRep>,Integer> outgoingEdges, |
121 | Set<PatternRelation<NodeRep>> patterns) | ||
121 | { | 122 | { |
122 | super(calculateDataHash(previousRepresentation,incomingEdges,outgoingEdges)) | 123 | super(calculateDataHash(previousRepresentation,incomingEdges,outgoingEdges,patterns)) |
123 | this.previousRepresentation = previousRepresentation | 124 | this.previousRepresentation = previousRepresentation |
124 | this.incomingEdges = new HashMap(incomingEdges) | 125 | this.incomingEdges = new HashMap(incomingEdges) |
125 | this.outgoingEdges = new HashMap(outgoingEdges) | 126 | this.outgoingEdges = new HashMap(outgoingEdges) |
127 | this.patterns=new HashSet(patterns) | ||
126 | } | 128 | } |
127 | 129 | ||
128 | static def private <NodeRep> int calculateDataHash( | 130 | static def private <NodeRep> int calculateDataHash( |
129 | NodeRep previousRepresentation, | 131 | NodeRep previousRepresentation, |
130 | Map<IncomingRelation<NodeRep>,Integer> incomingEdges, | 132 | Map<IncomingRelation<NodeRep>,Integer> incomingEdges, |
131 | Map<OutgoingRelation<NodeRep>,Integer> outgoingEdges) | 133 | Map<OutgoingRelation<NodeRep>,Integer> outgoingEdges, |
134 | Set<PatternRelation<NodeRep>> patterns) | ||
132 | { | 135 | { |
133 | val int prime = 31; | 136 | val int prime = 31; |
134 | var int result = previousRepresentation.hashCode; | 137 | var int result = previousRepresentation.hashCode; |
@@ -136,6 +139,8 @@ import java.util.List | |||
136 | result = prime * result + incomingEdges.hashCode(); | 139 | result = prime * result + incomingEdges.hashCode(); |
137 | if(outgoingEdges !== null) | 140 | if(outgoingEdges !== null) |
138 | result = prime * result + outgoingEdges.hashCode(); | 141 | result = prime * result + outgoingEdges.hashCode(); |
142 | if (patterns !== null) | ||
143 | result = prime * result + patterns.hashCode(); | ||
139 | return result; | 144 | return result; |
140 | } | 145 | } |
141 | 146 | ||
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/FurtherNodeDescriptorWithEquivalenceCounter.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/FurtherNodeDescriptorWithEquivalenceCounter.xtend index 22e890a2..28b936df 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/FurtherNodeDescriptorWithEquivalenceCounter.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/FurtherNodeDescriptorWithEquivalenceCounter.xtend | |||
@@ -2,15 +2,17 @@ package hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.ne | |||
2 | 2 | ||
3 | import java.util.Map | 3 | import java.util.Map |
4 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.DefinedElement | 4 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.DefinedElement |
5 | import java.util.Set | ||
5 | 6 | ||
6 | class FurtherNodeDescriptorWithEquivalenceCounter extends FurtherNodeDescriptor<AbstractNodeDescriptor> { | 7 | class FurtherNodeDescriptorWithEquivalenceCounter extends FurtherNodeDescriptor<AbstractNodeDescriptor> { |
7 | 8 | ||
8 | new(AbstractNodeDescriptor previousRepresentation, | 9 | new(AbstractNodeDescriptor previousRepresentation, |
9 | Map<IncomingRelation<AbstractNodeDescriptor>, Integer> incomingEdges, | 10 | Map<IncomingRelation<AbstractNodeDescriptor>, Integer> incomingEdges, |
10 | Map<OutgoingRelation<AbstractNodeDescriptor>, Integer> outgoingEdges, | 11 | Map<OutgoingRelation<AbstractNodeDescriptor>, Integer> outgoingEdges, |
11 | Map<DefinedElement, FurtherNodeDescriptor<AbstractNodeDescriptor>> node2Representation) | 12 | Map<DefinedElement, FurtherNodeDescriptor<AbstractNodeDescriptor>> node2Representation, |
13 | Set<PatternRelation<AbstractNodeDescriptor>> patterns) | ||
12 | { | 14 | { |
13 | super(previousRepresentation, incomingEdges, outgoingEdges) | 15 | super(previousRepresentation, incomingEdges, outgoingEdges, patterns) |
14 | } | 16 | } |
15 | 17 | ||
16 | } \ No newline at end of file | 18 | } \ No newline at end of file |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/PartialInterpretation2NeighbourhoodRepresentation.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/PartialInterpretation2NeighbourhoodRepresentation.xtend index 1d26a413..e6bc5706 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/PartialInterpretation2NeighbourhoodRepresentation.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/neighbourhood/PartialInterpretation2NeighbourhoodRepresentation.xtend | |||
@@ -99,7 +99,7 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
99 | def Map<DefinedElement, List<PatternRelation<DefinedElement>>> createPatternRelations( | 99 | def Map<DefinedElement, List<PatternRelation<DefinedElement>>> createPatternRelations( |
100 | PartialInterpretation model, Set<ViatraQueryMatcher<? extends IPatternMatch>> relevantPatterns) { | 100 | PartialInterpretation model, Set<ViatraQueryMatcher<? extends IPatternMatch>> relevantPatterns) { |
101 | val Map<DefinedElement, List<PatternRelation<DefinedElement>>> result=new HashMap; | 101 | val Map<DefinedElement, List<PatternRelation<DefinedElement>>> result=new HashMap; |
102 | if (relevantPatterns==null) return result; | 102 | if (relevantPatterns===null) return result; |
103 | for (element : model.elements) { | 103 | for (element : model.elements) { |
104 | result.put(element,new LinkedList<PatternRelation<DefinedElement>>) | 104 | result.put(element,new LinkedList<PatternRelation<DefinedElement>>) |
105 | } | 105 | } |
@@ -122,7 +122,7 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
122 | } | 122 | } |
123 | var id=0; | 123 | var id=0; |
124 | for (DefinedElement e:sanitizedMatch) { | 124 | for (DefinedElement e:sanitizedMatch) { |
125 | if (e!=null) { | 125 | if (e!==null) { |
126 | result.get(e).add(new PatternRelation<DefinedElement>(name,id,sanitizedMatch)) | 126 | result.get(e).add(new PatternRelation<DefinedElement>(name,id,sanitizedMatch)) |
127 | } | 127 | } |
128 | id++ | 128 | id++ |
@@ -132,13 +132,6 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
132 | println('''Ignored params '''+ignoredParams+''' of pattern '''+ name) | 132 | println('''Ignored params '''+ignoredParams+''' of pattern '''+ name) |
133 | } | 133 | } |
134 | 134 | ||
135 | /*for(relevantPattern : relevantPatterns) { | ||
136 | * relevantPattern.allMatches.forEach[ | ||
137 | * it. | ||
138 | * ] | ||
139 | }*/ | ||
140 | |||
141 | |||
142 | return result; | 135 | return result; |
143 | 136 | ||
144 | } | 137 | } |
@@ -222,7 +215,7 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
222 | } else if (range > 0) { | 215 | } else if (range > 0) { |
223 | val previous = doRecursiveNeighbourCalculation(model, types, IncomingRelations, OutgoingRelations, PatternRelations, | 216 | val previous = doRecursiveNeighbourCalculation(model, types, IncomingRelations, OutgoingRelations, PatternRelations, |
224 | range - 1, parallels, maxNumber) | 217 | range - 1, parallels, maxNumber) |
225 | val r = calculateFurtherNodeDescriptors(model, previous, IncomingRelations, OutgoingRelations, | 218 | val r = calculateFurtherNodeDescriptors(model, previous, IncomingRelations, OutgoingRelations,PatternRelations, |
226 | parallels, maxNumber) | 219 | parallels, maxNumber) |
227 | // println('''Level «range» finished.''') | 220 | // println('''Level «range» finished.''') |
228 | val res = createFurtherRepresentation(r.key, r.value, previous, deepRepresentation) | 221 | val res = createFurtherRepresentation(r.key, r.value, previous, deepRepresentation) |
@@ -235,7 +228,7 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
235 | } else | 228 | } else |
236 | return res | 229 | return res |
237 | } else if (range == FixPointRage) { | 230 | } else if (range == FixPointRage) { |
238 | return refineUntilFixpoint(model, types, IncomingRelations, OutgoingRelations, parallels, maxNumber) | 231 | return refineUntilFixpoint(model, types, IncomingRelations, OutgoingRelations, PatternRelations, parallels, maxNumber) |
239 | } else if (range == GraphWidthRange) { | 232 | } else if (range == GraphWidthRange) { |
240 | val width = this.getWidth(types, IncomingRelations, OutgoingRelations) | 233 | val width = this.getWidth(types, IncomingRelations, OutgoingRelations) |
241 | // println(width) | 234 | // println(width) |
@@ -246,7 +239,9 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
246 | 239 | ||
247 | def private refineUntilFixpoint(PartialInterpretation model, Map<DefinedElement, Set<String>> types, | 240 | def private refineUntilFixpoint(PartialInterpretation model, Map<DefinedElement, Set<String>> types, |
248 | Map<DefinedElement, List<IncomingRelation<DefinedElement>>> IncomingRelations, | 241 | Map<DefinedElement, List<IncomingRelation<DefinedElement>>> IncomingRelations, |
249 | Map<DefinedElement, List<OutgoingRelation<DefinedElement>>> OutgoingRelations, int parallels, | 242 | Map<DefinedElement, List<OutgoingRelation<DefinedElement>>> OutgoingRelations, |
243 | Map<DefinedElement, List<PatternRelation<DefinedElement>>> PatternRelations, | ||
244 | int parallels, | ||
250 | int maxNumbers) { | 245 | int maxNumbers) { |
251 | var lastRange = 0 | 246 | var lastRange = 0 |
252 | val last = calculateLocalNodeDescriptors(model, types, maxNumbers) | 247 | val last = calculateLocalNodeDescriptors(model, types, maxNumbers) |
@@ -256,7 +251,7 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
256 | do { | 251 | do { |
257 | val nextRange = lastRange + 1 | 252 | val nextRange = lastRange + 1 |
258 | val next = calculateFurtherNodeDescriptors(model, lastRepresentation, IncomingRelations, | 253 | val next = calculateFurtherNodeDescriptors(model, lastRepresentation, IncomingRelations, |
259 | OutgoingRelations, parallels, maxNumbers) | 254 | OutgoingRelations, PatternRelations, parallels, maxNumbers) |
260 | val nextRepresentation = createFurtherRepresentation(next.key, next.value, lastRepresentation, | 255 | val nextRepresentation = createFurtherRepresentation(next.key, next.value, lastRepresentation, |
261 | deepRepresentation) | 256 | deepRepresentation) |
262 | 257 | ||
@@ -286,9 +281,9 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
286 | node2Type.put(element, new HashSet) | 281 | node2Type.put(element, new HashSet) |
287 | } | 282 | } |
288 | 283 | ||
289 | // for(typeDefinition : model.problem.types.filter(TypeDefinition)) { | 284 | // for(typeDefinition : model.problem.types.filter(TypeDefinition)) { |
290 | // // Dont need | 285 | // // Dont need |
291 | // } | 286 | // } |
292 | for (typeInterpretation : model.partialtypeinterpratation) { | 287 | for (typeInterpretation : model.partialtypeinterpratation) { |
293 | if (typeInterpretation instanceof PartialPrimitiveInterpretation) { | 288 | if (typeInterpretation instanceof PartialPrimitiveInterpretation) { |
294 | } else if (typeInterpretation instanceof PartialComplexTypeInterpretation) { | 289 | } else if (typeInterpretation instanceof PartialComplexTypeInterpretation) { |
@@ -328,7 +323,7 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
328 | } | 323 | } |
329 | 324 | ||
330 | /** | 325 | /** |
331 | * Creates a local representation of the objects (aka zero range neighbourhood) | 326 | * Creates the representation of the initial shape (aka zero range neighbourhood) |
332 | */ | 327 | */ |
333 | def abstract protected NeighbourhoodWithTraces<ModelRepresentation, NodeRepresentation> createLocalRepresentation( | 328 | def abstract protected NeighbourhoodWithTraces<ModelRepresentation, NodeRepresentation> createLocalRepresentation( |
334 | Map<DefinedElement, LocalNodeDescriptor> node2Representation, | 329 | Map<DefinedElement, LocalNodeDescriptor> node2Representation, |
@@ -336,7 +331,7 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
336 | ) | 331 | ) |
337 | 332 | ||
338 | /** | 333 | /** |
339 | * Creates a | 334 | * Creates the representation of a shape (aka neighbourhood) with positive range |
340 | */ | 335 | */ |
341 | def abstract protected NeighbourhoodWithTraces<ModelRepresentation, NodeRepresentation> createFurtherRepresentation( | 336 | def abstract protected NeighbourhoodWithTraces<ModelRepresentation, NodeRepresentation> createFurtherRepresentation( |
342 | Map<FurtherNodeDescriptor<NodeRepresentation>, Integer> nodeDescriptors, | 337 | Map<FurtherNodeDescriptor<NodeRepresentation>, Integer> nodeDescriptors, |
@@ -383,6 +378,19 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
383 | } | 378 | } |
384 | return res; | 379 | return res; |
385 | } | 380 | } |
381 | |||
382 | private def calculatePatterns(Map<DefinedElement, List<PatternRelation<DefinedElement>>> PatternRelations, | ||
383 | DefinedElement object, | ||
384 | Map<DefinedElement, ? extends NodeRepresentation> previousNodeRepresentations) { | ||
385 | val res = new HashSet<PatternRelation<NodeRepresentation>>() | ||
386 | |||
387 | for (patternRelation : PatternRelations.get(object)) { | ||
388 | val matchshape=patternRelation.parameters.map[previousNodeRepresentations.getOrDefault(it,null)] | ||
389 | res.add(new PatternRelation<NodeRepresentation>(patternRelation.patternName,patternRelation.param,matchshape)) | ||
390 | } | ||
391 | |||
392 | return res | ||
393 | } | ||
386 | 394 | ||
387 | /*def private <KEY,VALUE> void addOrCreate_Set(Map<KEY,Set<VALUE>> map, KEY key, VALUE value) { | 395 | /*def private <KEY,VALUE> void addOrCreate_Set(Map<KEY,Set<VALUE>> map, KEY key, VALUE value) { |
388 | * var Set<VALUE> s; | 396 | * var Set<VALUE> s; |
@@ -397,7 +405,9 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
397 | private def calculateFurtherNodeDescriptors(PartialInterpretation model, | 405 | private def calculateFurtherNodeDescriptors(PartialInterpretation model, |
398 | NeighbourhoodWithTraces<ModelRepresentation, NodeRepresentation> previous, | 406 | NeighbourhoodWithTraces<ModelRepresentation, NodeRepresentation> previous, |
399 | Map<DefinedElement, List<IncomingRelation<DefinedElement>>> IncomingRelations, | 407 | Map<DefinedElement, List<IncomingRelation<DefinedElement>>> IncomingRelations, |
400 | Map<DefinedElement, List<OutgoingRelation<DefinedElement>>> OutgoingRelations, int parallels, | 408 | Map<DefinedElement, List<OutgoingRelation<DefinedElement>>> OutgoingRelations, |
409 | Map<DefinedElement, List<PatternRelation<DefinedElement>>> PatternRelations, | ||
410 | int parallels, | ||
401 | int maxNumber) { | 411 | int maxNumber) { |
402 | val previousNodeRepresentations = previous.nodeRepresentations | 412 | val previousNodeRepresentations = previous.nodeRepresentations |
403 | val node2Representation = new HashMap<DefinedElement, FurtherNodeDescriptor<NodeRepresentation>> | 413 | val node2Representation = new HashMap<DefinedElement, FurtherNodeDescriptor<NodeRepresentation>> |
@@ -419,14 +429,15 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
419 | previousNodeRepresentations, parallels) | 429 | previousNodeRepresentations, parallels) |
420 | val outgoingEdges = this.calcuateOutgoingEdges(OutgoingRelations, object, | 430 | val outgoingEdges = this.calcuateOutgoingEdges(OutgoingRelations, object, |
421 | previousNodeRepresentations, parallels) | 431 | previousNodeRepresentations, parallels) |
422 | // TODO: patternDescriptors | 432 | val patterns = this.calculatePatterns(PatternRelations, object, previousNodeRepresentations) |
433 | |||
423 | val previousType = previousNodeRepresentations.get(object) | 434 | val previousType = previousNodeRepresentations.get(object) |
424 | 435 | ||
425 | if (previousType === null) { | 436 | if (previousType === null) { |
426 | println("Error in state coder") | 437 | println("Error in state coder") |
427 | } | 438 | } |
428 | 439 | ||
429 | val nodeDescriptor = new FurtherNodeDescriptor(previousType, incomingEdges, outgoingEdges) | 440 | val nodeDescriptor = new FurtherNodeDescriptor(previousType, incomingEdges, outgoingEdges, patterns) |
430 | 441 | ||
431 | if (this.mergeSimilarNeighbourhood) { | 442 | if (this.mergeSimilarNeighbourhood) { |
432 | if (descriptor2Number.containsKey(nodeDescriptor)) { | 443 | if (descriptor2Number.containsKey(nodeDescriptor)) { |