diff options
author | 2017-07-05 16:41:03 +0200 | |
---|---|---|
committer | 2017-07-05 16:41:03 +0200 | |
commit | 267ada8df5c5cbeec194b499450dac6d4495f3fd (patch) | |
tree | 552ff02f924dc47c4022e7315bc3420a74261c1b /Domains/hu.bme.mit.inf.yakinduModelExtractor/src/hu/bme/mit/inf/yakinduModelExtractor | |
parent | Pattern coverage measuring program. (diff) | |
download | VIATRA-Generator-267ada8df5c5cbeec194b499450dac6d4495f3fd.tar.gz VIATRA-Generator-267ada8df5c5cbeec194b499450dac6d4495f3fd.tar.zst VIATRA-Generator-267ada8df5c5cbeec194b499450dac6d4495f3fd.zip |
Added progress and basic statstic report to the yakindu model
translator.
Diffstat (limited to 'Domains/hu.bme.mit.inf.yakinduModelExtractor/src/hu/bme/mit/inf/yakinduModelExtractor')
-rw-r--r-- | Domains/hu.bme.mit.inf.yakinduModelExtractor/src/hu/bme/mit/inf/yakinduModelExtractor/Main.java | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/Domains/hu.bme.mit.inf.yakinduModelExtractor/src/hu/bme/mit/inf/yakinduModelExtractor/Main.java b/Domains/hu.bme.mit.inf.yakinduModelExtractor/src/hu/bme/mit/inf/yakinduModelExtractor/Main.java index ec525fd6..870424d8 100644 --- a/Domains/hu.bme.mit.inf.yakinduModelExtractor/src/hu/bme/mit/inf/yakinduModelExtractor/Main.java +++ b/Domains/hu.bme.mit.inf.yakinduModelExtractor/src/hu/bme/mit/inf/yakinduModelExtractor/Main.java | |||
@@ -13,6 +13,9 @@ public class Main { | |||
13 | ModelManager manager = new ModelManager(); | 13 | ModelManager manager = new ModelManager(); |
14 | Yakindu2CommonModel converter = new Yakindu2CommonModel(); | 14 | Yakindu2CommonModel converter = new Yakindu2CommonModel(); |
15 | 15 | ||
16 | int models = 0; | ||
17 | int objects = 0; | ||
18 | |||
16 | String years[] = {"2015","2016","2017"}; | 19 | String years[] = {"2015","2016","2017"}; |
17 | for(String year : years) { | 20 | for(String year : years) { |
18 | String folderPath = "D:\\Eclipse\\GIT\\RemoHF\\"+year; | 21 | String folderPath = "D:\\Eclipse\\GIT\\RemoHF\\"+year; |
@@ -31,14 +34,31 @@ public class Main { | |||
31 | 34 | ||
32 | if(s!=null) { | 35 | if(s!=null) { |
33 | EObject s2 = converter.transform(s); | 36 | EObject s2 = converter.transform(s); |
34 | manager.saveModel(s2, "output/R"+year+index+".xmi"); | 37 | //manager.saveModel(s2, "output/R"+year+index+".xmi"); |
38 | int countObjects = countObjects(s2); | ||
39 | System.out.println(countObjects); | ||
40 | objects += countObjects; | ||
41 | models++; | ||
35 | } | 42 | } |
36 | System.out.println(year + " Progress: " + 100.0*index/paths.size() + "%"); | 43 | //System.out.println(year + " Progress: " + 100.0*index/paths.size() + "%"); |
37 | index++; | 44 | index++; |
38 | } | 45 | } |
39 | 46 | ||
40 | System.out.println(year + " done."); | 47 | System.out.println(year + " done."); |
41 | } | 48 | } |
42 | System.out.println("All done."); | 49 | System.out.println("All done."); |
50 | System.out.println(objects); | ||
51 | System.out.println(models); | ||
52 | System.out.println(1.0*objects/models); | ||
53 | } | ||
54 | |||
55 | private static int countObjects(EObject root) { | ||
56 | int objects = 1; | ||
57 | TreeIterator<EObject> i = root.eAllContents(); | ||
58 | while(i.hasNext()) { | ||
59 | i.next(); | ||
60 | objects++; | ||
61 | } | ||
62 | return objects; | ||
43 | } | 63 | } |
44 | } | 64 | } |