diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/PartialInterpretation2Graphviz.xtend | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/PartialInterpretation2Graphviz.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/PartialInterpretation2Graphviz.xtend index e30b27ac..78326207 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/PartialInterpretation2Graphviz.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.visualisation/src/hu/bme/mit/inf/dslreasoner/visualisation/pi2graphviz/PartialInterpretation2Graphviz.xtend | |||
@@ -10,11 +10,15 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation | |||
10 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type | 10 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type |
11 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDefinition | 11 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDefinition |
12 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.BinaryElementRelationLink | 12 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.BinaryElementRelationLink |
13 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.BooleanElement | ||
14 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.IntegerElement | ||
15 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialComplexTypeInterpretation | ||
13 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation | 16 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation |
17 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.RealElement | ||
18 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.StringElement | ||
14 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretationVisualisation | 19 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretationVisualisation |
15 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretationVisualiser | 20 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretationVisualiser |
16 | import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace | 21 | import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace |
17 | import java.util.Collection | ||
18 | import java.util.HashMap | 22 | import java.util.HashMap |
19 | import java.util.HashSet | 23 | import java.util.HashSet |
20 | import java.util.LinkedList | 24 | import java.util.LinkedList |
@@ -45,10 +49,7 @@ class GraphvizVisualiser implements PartialInterpretationVisualiser { | |||
45 | return | 49 | return |
46 | model.problem.elements + | 50 | model.problem.elements + |
47 | model.newElements + | 51 | model.newElements + |
48 | model.booleanelements+ | 52 | model.openWorldElements |
49 | model.integerelements+ | ||
50 | model.stringelement+ | ||
51 | model.realelements | ||
52 | } | 53 | } |
53 | 54 | ||
54 | def private visualisePartialInterpretation(PartialInterpretation partialInterpretation, boolean concretizationOnly) { | 55 | def private visualisePartialInterpretation(PartialInterpretation partialInterpretation, boolean concretizationOnly) { |
@@ -72,7 +73,7 @@ class GraphvizVisualiser implements PartialInterpretationVisualiser { | |||
72 | mustTypes.get(element)+=typeDefinition | 73 | mustTypes.get(element)+=typeDefinition |
73 | } | 74 | } |
74 | } | 75 | } |
75 | for(partialTypeInterpretations: partialInterpretation.partialtypeinterpratation) { | 76 | for(partialTypeInterpretations: partialInterpretation.partialtypeinterpratation.filter(PartialComplexTypeInterpretation)) { |
76 | for(element : partialTypeInterpretations.elements) { | 77 | for(element : partialTypeInterpretations.elements) { |
77 | mustTypes.get(element)+=partialTypeInterpretations.interpretationOf | 78 | mustTypes.get(element)+=partialTypeInterpretations.interpretationOf |
78 | } | 79 | } |
@@ -105,10 +106,10 @@ class GraphvizVisualiser implements PartialInterpretationVisualiser { | |||
105 | // elements2Node.put(newElement,image) | 106 | // elements2Node.put(newElement,image) |
106 | // } | 107 | // } |
107 | 108 | ||
108 | partialInterpretation.booleanelements.drawDataTypes([it.value.toString],elements2Node,elements2ID) | 109 | partialInterpretation.newElements.filter(BooleanElement).drawDataTypes([it.value.toString],elements2Node,elements2ID) |
109 | partialInterpretation.integerelements.drawDataTypes([it.value.toString],elements2Node,elements2ID) | 110 | partialInterpretation.newElements.filter(IntegerElement).drawDataTypes([it.value.toString],elements2Node,elements2ID) |
110 | partialInterpretation.stringelement.drawDataTypes(['''"«it.value.toString»"'''],elements2Node,elements2ID) | 111 | partialInterpretation.newElements.filter(StringElement).drawDataTypes(['''"«it.value.toString»"'''],elements2Node,elements2ID) |
111 | partialInterpretation.realelements.drawDataTypes([it.value.toString],elements2Node,elements2ID) | 112 | partialInterpretation.newElements.filter(RealElement).drawDataTypes([it.value.toString],elements2Node,elements2ID) |
112 | 113 | ||
113 | // Drawing the edges | 114 | // Drawing the edges |
114 | val edges = new HashMap | 115 | val edges = new HashMap |
@@ -134,7 +135,7 @@ class GraphvizVisualiser implements PartialInterpretationVisualiser { | |||
134 | return new GraphvizVisualisation(graph) | 135 | return new GraphvizVisualisation(graph) |
135 | } | 136 | } |
136 | 137 | ||
137 | def protected <T extends DefinedElement> void drawDataTypes(Collection<T> collection, Function1<T,String> namer, HashMap<DefinedElement, Node> elements2Node, HashMap<DefinedElement, String> elements2ID) { | 138 | def protected <T extends DefinedElement> void drawDataTypes(Iterable<T> collection, Function1<T,String> namer, HashMap<DefinedElement, Node> elements2Node, HashMap<DefinedElement, String> elements2ID) { |
138 | for(booleanElementIndex: 0..<collection.size) { | 139 | for(booleanElementIndex: 0..<collection.size) { |
139 | val newElement = collection.get(booleanElementIndex) | 140 | val newElement = collection.get(booleanElementIndex) |
140 | val id = namer.apply(newElement) | 141 | val id = namer.apply(newElement) |