aboutsummaryrefslogtreecommitdiffstats
path: root/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/PartialInterpretationGraph.xtend
diff options
context:
space:
mode:
Diffstat (limited to 'Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/PartialInterpretationGraph.xtend')
-rw-r--r--Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/PartialInterpretationGraph.xtend17
1 files changed, 10 insertions, 7 deletions
diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/PartialInterpretationGraph.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/PartialInterpretationGraph.xtend
index bb679bf6..ef68f366 100644
--- a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/PartialInterpretationGraph.xtend
+++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/graph/PartialInterpretationGraph.xtend
@@ -21,16 +21,19 @@ class PartialInterpretationGraph extends Graph{
21 //only need the name of the reference type (remove everything with and after "reference") 21 //only need the name of the reference type (remove everything with and after "reference")
22 var n = it.name.split(" ").get(0); 22 var n = it.name.split(" ").get(0);
23 // TODO: Here is to only consider one part of opposite edges 23 // TODO: Here is to only consider one part of opposite edges
24 //if(!n.equals('target') && !n.equals('source') /* && !n.equals('incomingTransitions')*/){ 24 if(!n.equals('target') && !n.equals('source') /* && !n.equals('incomingTransitions')*/){
25 this.statistic.addEdgeType(n); 25 this.statistic.addEdgeType(n);
26 //} 26 }
27 ] 27 ]
28 // add all elements 28 // add all elements
29 val typeInterpretations = getTypes(partial); 29 val typeInterpretations = getTypes(partial);
30 for(type : typeInterpretations){ 30 for(type : typeInterpretations){
31 var typeName = type.interpretationOf.name.replace(classSuffix, ''); 31 //Only consider the most concrete class
32 for(node : type.elements){ 32 if(type.interpretationOf.subtypes.size == 0){
33 this.statistic.addNodeWithType(node, typeName); 33 var typeName = type.interpretationOf.name.replace(classSuffix, '');
34 for(node : type.elements){
35 this.statistic.addNodeWithType(node, typeName);
36 }
34 } 37 }
35 } 38 }
36 39
@@ -38,11 +41,11 @@ class PartialInterpretationGraph extends Graph{
38 //only need the name of the reference type (remove everything with and after "reference") 41 //only need the name of the reference type (remove everything with and after "reference")
39 val type = relationInterpretation.interpretationOf.name.split(" ").get(0); 42 val type = relationInterpretation.interpretationOf.name.split(" ").get(0);
40 // TODO: Here is to only consider one part of opposite edges 43 // TODO: Here is to only consider one part of opposite edges
41 //if(!type.equals('target') && !type.equals('source') /*&& !type.equals('incomingTransitions')*/){ 44 if(!type.equals('target') && !type.equals('source') /*&& !type.equals('incomingTransitions')*/){
42 for(edge : relationInterpretation.relationlinks.filter(BinaryElementRelationLink)){ 45 for(edge : relationInterpretation.relationlinks.filter(BinaryElementRelationLink)){
43 statistic.addEdge(edge.param1, edge.param2, type); 46 statistic.addEdge(edge.param1, edge.param2, type);
44 } 47 }
45 //} 48 }
46 } 49 }
47 50
48 this.name = name; 51 this.name = name;