diff options
Diffstat (limited to 'Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io')
2 files changed, 10 insertions, 3 deletions
diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend index 858113e9..053e0da3 100644 --- a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/GraphReader.xtend | |||
@@ -22,6 +22,7 @@ import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl | |||
22 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl | 22 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl |
23 | import org.eclipse.emf.ecore.EGenericType | 23 | import org.eclipse.emf.ecore.EGenericType |
24 | import org.eclipse.emf.ecore.EStructuralFeature | 24 | import org.eclipse.emf.ecore.EStructuralFeature |
25 | import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.TypedClusteringCoefficientMetric | ||
25 | 26 | ||
26 | class GraphReader{ | 27 | class GraphReader{ |
27 | val ResourceSet resSet = new ResourceSetImpl(); | 28 | val ResourceSet resSet = new ResourceSetImpl(); |
@@ -58,8 +59,6 @@ class GraphReader{ | |||
58 | var count = 1 | 59 | var count = 1 |
59 | //check all files in the directory with suffix | 60 | //check all files in the directory with suffix |
60 | for(String name : dir.list.filter[it| it.endsWith(suffix)]){ | 61 | for(String name : dir.list.filter[it| it.endsWith(suffix)]){ |
61 | println(name) | ||
62 | println(count) | ||
63 | val file = new File(name); | 62 | val file = new File(name); |
64 | val roots = readModel(EObject, path, file.name); | 63 | val roots = readModel(EObject, path, file.name); |
65 | //add a list of metrics | 64 | //add a list of metrics |
diff --git a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/RepMetricsReader.xtend b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/RepMetricsReader.xtend index 06e88efc..2e7be586 100644 --- a/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/RepMetricsReader.xtend +++ b/Metrics/Metrics-Calculation/ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator/src/ca/mcgill/ecse/dslreasoner/realistic/metrics/calculator/io/RepMetricsReader.xtend | |||
@@ -2,6 +2,7 @@ package ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.io | |||
2 | 2 | ||
3 | import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.app.Domain | 3 | import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.app.Domain |
4 | import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MetricSampleGroup | 4 | import ca.mcgill.ecse.dslreasoner.realistic.metrics.calculator.metrics.MetricSampleGroup |
5 | import github.impl.GithubPackageImpl | ||
5 | import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.impl.YakindummPackageImpl | 6 | import hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.impl.YakindummPackageImpl |
6 | import java.util.HashMap | 7 | import java.util.HashMap |
7 | import org.eclipse.emf.ecore.EReference | 8 | import org.eclipse.emf.ecore.EReference |
@@ -19,7 +20,7 @@ class RepMetricsReader { | |||
19 | }else if (d == Domain.Ecore){ | 20 | }else if (d == Domain.Ecore){ |
20 | reader = new GraphReader(EcorePackageImpl.eINSTANCE, '.ecore'); | 21 | reader = new GraphReader(EcorePackageImpl.eINSTANCE, '.ecore'); |
21 | }else if (d == Domain.Github){ | 22 | }else if (d == Domain.Github){ |
22 | // Initialize the reader with github package | 23 | reader = new GraphReader(GithubPackageImpl.eINSTANCE, '.githubmodel') |
23 | } | 24 | } |
24 | 25 | ||
25 | domain = d; | 26 | domain = d; |
@@ -58,6 +59,13 @@ class RepMetricsReader { | |||
58 | nodeTypeSamples.put('EGenericType', 0.002014098690835851); | 59 | nodeTypeSamples.put('EGenericType', 0.002014098690835851); |
59 | nodeTypeSamples.put('EOperation', 0.009415911379657605); | 60 | nodeTypeSamples.put('EOperation', 0.009415911379657605); |
60 | nodeTypeSamples.put('ETypeParameter', 0.0007049345417925478); | 61 | nodeTypeSamples.put('ETypeParameter', 0.0007049345417925478); |
62 | }else if (d == Domain.Github){ | ||
63 | nodeTypeSamples.put('Project', 0.012636538873420432); | ||
64 | nodeTypeSamples.put('Commit', 0.5525808524309276); | ||
65 | nodeTypeSamples.put('User', 0.05847076461769116); | ||
66 | nodeTypeSamples.put('Issue', 0.12743628185907047); | ||
67 | nodeTypeSamples.put('PullRequest', 0.07560505461554937); | ||
68 | nodeTypeSamples.put('IssueEvent', 0.17327050760334123); | ||
61 | } | 69 | } |
62 | 70 | ||
63 | 71 | ||