diff options
author | 2018-03-24 21:44:49 -0400 | |
---|---|---|
committer | 2018-03-24 21:44:49 -0400 | |
commit | f42954a45bea9f3e40090447804f33f12c080640 (patch) | |
tree | 1c57d4ca595bf7825460c6aa080f93ea04d5689c /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver | |
parent | Factory for string literals. (diff) | |
download | VIATRA-Generator-f42954a45bea9f3e40090447804f33f12c080640.tar.gz VIATRA-Generator-f42954a45bea9f3e40090447804f33f12c080640.tar.zst VIATRA-Generator-f42954a45bea9f3e40090447804f33f12c080640.zip |
upgraded attribute support for the graph solver
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver')
2 files changed, 20 insertions, 4 deletions
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 936f2117..a5739edf 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 | |||
@@ -184,7 +184,13 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
184 | } | 184 | } |
185 | 185 | ||
186 | def private getElements(PartialInterpretation model) { | 186 | def private getElements(PartialInterpretation model) { |
187 | return model.problem.elements + model.newElements | 187 | return |
188 | model.problem.elements + | ||
189 | model.newElements + | ||
190 | model.booleanelements+ | ||
191 | model.integerelements+ | ||
192 | model.stringelement+ | ||
193 | model.realelements | ||
188 | } | 194 | } |
189 | 195 | ||
190 | def private fillTypes(PartialInterpretation model, Map<DefinedElement, Set<String>> node2Type, Set<TypeDeclaration> relevantTypes) { | 196 | def private fillTypes(PartialInterpretation model, Map<DefinedElement, Set<String>> node2Type, Set<TypeDeclaration> relevantTypes) { |
@@ -222,8 +228,8 @@ abstract class PartialInterpretation2NeighbourhoodRepresentation<ModelRepresenta | |||
222 | if(type.isRelevant(relevantRelations)) { | 228 | if(type.isRelevant(relevantRelations)) { |
223 | for(link : relationInterpretation.relationlinks) { | 229 | for(link : relationInterpretation.relationlinks) { |
224 | if(link instanceof BinaryElementRelationLink) { | 230 | if(link instanceof BinaryElementRelationLink) { |
225 | OutgoingRelations.get(link.param1) += new OutgoingRelation(link.param2,type.name) | 231 | OutgoingRelations.get(link.param1) += new OutgoingRelation(link.param2,type.name) |
226 | IncomingRelations.get(link.param2) += new IncomingRelation(link.param1,type.name) | 232 | IncomingRelations.get(link.param2) += new IncomingRelation(link.param1,type.name) |
227 | } else throw new UnsupportedOperationException | 233 | } else throw new UnsupportedOperationException |
228 | } | 234 | } |
229 | } | 235 | } |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/visualisation/PartialInterpretation2Gml.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/visualisation/PartialInterpretation2Gml.xtend index 819cae00..6e948827 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/visualisation/PartialInterpretation2Gml.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/visualisation/PartialInterpretation2Gml.xtend | |||
@@ -12,6 +12,16 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation | |||
12 | import java.util.Set | 12 | import java.util.Set |
13 | 13 | ||
14 | class PartialInterpretation2Gml { | 14 | class PartialInterpretation2Gml { |
15 | def private getElements(PartialInterpretation model) { | ||
16 | return | ||
17 | model.problem.elements + | ||
18 | model.newElements + | ||
19 | model.booleanelements+ | ||
20 | model.integerelements+ | ||
21 | model.stringelement+ | ||
22 | model.realelements | ||
23 | } | ||
24 | |||
15 | def public transform(PartialInterpretation i) { | 25 | def public transform(PartialInterpretation i) { |
16 | val p = i.problem | 26 | val p = i.problem |
17 | val Map<DefinedElement, Integer> objectToID = new HashMap | 27 | val Map<DefinedElement, Integer> objectToID = new HashMap |
@@ -19,7 +29,7 @@ class PartialInterpretation2Gml { | |||
19 | ''' | 29 | ''' |
20 | graph | 30 | graph |
21 | [ | 31 | [ |
22 | «FOR object:p.elements + i.newElements SEPARATOR '\n'» | 32 | «FOR object:i.elements SEPARATOR '\n'» |
23 | «this.transformObject(object,object.typesOfElement(i),objectToID)» | 33 | «this.transformObject(object,object.typesOfElement(i),objectToID)» |
24 | «ENDFOR» | 34 | «ENDFOR» |
25 | «FOR relation:i.partialrelationinterpretation» | 35 | «FOR relation:i.partialrelationinterpretation» |