diff options
Diffstat (limited to 'Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/PartialInterpretationMetricDistance.xtend')
1 files changed, 7 insertions, 3 deletions
diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/PartialInterpretationMetricDistance.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/PartialInterpretationMetricDistance.xtend index 66dcdff6..b2288f52 100644 --- a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/PartialInterpretationMetricDistance.xtend +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/app/PartialInterpretationMetricDistance.xtend | |||
@@ -20,6 +20,7 @@ import java.util.List | |||
20 | import java.util.Map | 20 | import java.util.Map |
21 | import org.apache.commons.math3.stat.regression.OLSMultipleLinearRegression | 21 | import org.apache.commons.math3.stat.regression.OLSMultipleLinearRegression |
22 | import org.eclipse.xtend.lib.annotations.Accessors | 22 | import org.eclipse.xtend.lib.annotations.Accessors |
23 | import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.EdgeTypeMetric | ||
23 | 24 | ||
24 | class PartialInterpretationMetricDistance { | 25 | class PartialInterpretationMetricDistance { |
25 | 26 | ||
@@ -34,8 +35,8 @@ class PartialInterpretationMetricDistance { | |||
34 | var LinearModel linearModel; | 35 | var LinearModel linearModel; |
35 | 36 | ||
36 | 37 | ||
37 | new(){ | 38 | new(Domain d){ |
38 | var metrics = RepMetricsReader.read(Domain.Yakinduum); | 39 | var metrics = RepMetricsReader.read(d); |
39 | this.g = metrics; | 40 | this.g = metrics; |
40 | ks = new KSDistance(g); | 41 | ks = new KSDistance(g); |
41 | js = new JSDistance(g); | 42 | js = new JSDistance(g); |
@@ -53,6 +54,7 @@ class PartialInterpretationMetricDistance { | |||
53 | metrics.add(new NodeActivityMetric()); | 54 | metrics.add(new NodeActivityMetric()); |
54 | metrics.add(new MultiplexParticipationCoefficientMetric()); | 55 | metrics.add(new MultiplexParticipationCoefficientMetric()); |
55 | metrics.add(new NodeTypeMetric()); | 56 | metrics.add(new NodeTypeMetric()); |
57 | metrics.add(new EdgeTypeMetric()); | ||
56 | val metricCalculator = new PartialInterpretationGraph(partial, metrics, null); | 58 | val metricCalculator = new PartialInterpretationGraph(partial, metrics, null); |
57 | var metricSamples = metricCalculator.evaluateAllMetricsToSamples(); | 59 | var metricSamples = metricCalculator.evaluateAllMetricsToSamples(); |
58 | 60 | ||
@@ -63,6 +65,7 @@ class PartialInterpretationMetricDistance { | |||
63 | //var typedOutDegree = ks.typedOutDegreeDistance(metricSamples.typedOutDegreeSamples); | 65 | //var typedOutDegree = ks.typedOutDegreeDistance(metricSamples.typedOutDegreeSamples); |
64 | var distance = new MetricDistanceGroup(mpc, na, outDegree, nodeType); | 66 | var distance = new MetricDistanceGroup(mpc, na, outDegree, nodeType); |
65 | distance.nodeTypeInfo = metricSamples.nodeTypeSamples; | 67 | distance.nodeTypeInfo = metricSamples.nodeTypeSamples; |
68 | distance.edgeTypeDistance = ks.edgeTypeDistance(metricSamples.edgeTypeSamples); | ||
66 | return distance; | 69 | return distance; |
67 | } | 70 | } |
68 | 71 | ||
@@ -177,7 +180,8 @@ class MetricDistanceGroup{ | |||
177 | var double outDegreeDistance; | 180 | var double outDegreeDistance; |
178 | var double nodeTypeDistance; | 181 | var double nodeTypeDistance; |
179 | protected var HashMap<String, Double> nodeTypeInfo; | 182 | protected var HashMap<String, Double> nodeTypeInfo; |
180 | 183 | public var double edgeTypeDistance; | |
184 | |||
181 | new(double mpcDistance, double naDistance, double outDegreeDistance, double nodeTypeDistance){ | 185 | new(double mpcDistance, double naDistance, double outDegreeDistance, double nodeTypeDistance){ |
182 | this.mpcDistance = mpcDistance; | 186 | this.mpcDistance = mpcDistance; |
183 | this.naDistance = naDistance; | 187 | this.naDistance = naDistance; |