diff options
author | 2020-05-13 00:34:43 -0400 | |
---|---|---|
committer | 2020-05-13 00:34:43 -0400 | |
commit | 4d914f3a77f64dc326933921b03735d4aabd9214 (patch) | |
tree | 2d2a7374c5becd54029e872cc38960cf3ce3610b /Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/GenerateFromConfig.java | |
parent | Adjust FamilyTree MM. Add new Taxation MM with possible Multiple Roots (diff) | |
download | VIATRA-Generator-4d914f3a77f64dc326933921b03735d4aabd9214.tar.gz VIATRA-Generator-4d914f3a77f64dc326933921b03735d4aabd9214.tar.zst VIATRA-Generator-4d914f3a77f64dc326933921b03735d4aabd9214.zip |
Adjust measurement setup. TaxationWithRoot support. JAR creation
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/GenerateFromConfig.java')
-rw-r--r-- | Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/GenerateFromConfig.java | 119 |
1 files changed, 50 insertions, 69 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/GenerateFromConfig.java b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/GenerateFromConfig.java index 5410113e..763e2917 100644 --- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/GenerateFromConfig.java +++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/xtend-gen/run/GenerateFromConfig.java | |||
@@ -22,9 +22,7 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.Statistics; | |||
22 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasonerConfiguration; | 22 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasonerConfiguration; |
23 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace; | 23 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace; |
24 | import java.io.PrintWriter; | 24 | import java.io.PrintWriter; |
25 | import java.math.BigDecimal; | ||
26 | import java.text.SimpleDateFormat; | 25 | import java.text.SimpleDateFormat; |
27 | import java.util.ArrayList; | ||
28 | import java.util.Date; | 26 | import java.util.Date; |
29 | import java.util.Map; | 27 | import java.util.Map; |
30 | import org.eclipse.core.runtime.NullProgressMonitor; | 28 | import org.eclipse.core.runtime.NullProgressMonitor; |
@@ -32,26 +30,25 @@ import org.eclipse.emf.common.util.URI; | |||
32 | import org.eclipse.emf.ecore.resource.Resource; | 30 | import org.eclipse.emf.ecore.resource.Resource; |
33 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; | 31 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; |
34 | import org.eclipse.xtend2.lib.StringConcatenation; | 32 | import org.eclipse.xtend2.lib.StringConcatenation; |
35 | import org.eclipse.xtext.xbase.lib.CollectionExtensions; | ||
36 | import org.eclipse.xtext.xbase.lib.Exceptions; | 33 | import org.eclipse.xtext.xbase.lib.Exceptions; |
37 | import org.eclipse.xtext.xbase.lib.Functions.Function0; | 34 | import org.eclipse.xtext.xbase.lib.Functions.Function0; |
38 | import org.eclipse.xtext.xbase.lib.InputOutput; | 35 | import org.eclipse.xtext.xbase.lib.InputOutput; |
39 | 36 | ||
40 | @SuppressWarnings("all") | 37 | @SuppressWarnings("all") |
41 | public class GenerateFromConfig { | 38 | public class GenerateFromConfig { |
42 | private static final int SIZE_LB = 20; | 39 | private static final int SIZE_LB = 200; |
43 | 40 | ||
44 | private static final int SIZE_UB = 20; | 41 | private static final int SIZE_UB = 200; |
45 | 42 | ||
46 | private static final int SIZE_MUL = 1; | 43 | private static final int SIZE_MUL = 1; |
47 | 44 | ||
48 | private static final int SIZE_INC = 5; | 45 | private static final int SIZE_INC = 5; |
49 | 46 | ||
50 | private static int REPS = 5; | 47 | private static int REPS = 3; |
51 | 48 | ||
52 | private static final int RUNTIME = 2100; | 49 | private static final int RUNTIME = 600; |
53 | 50 | ||
54 | private static final String DOMAIN = "Satellite"; | 51 | private static final String DOMAIN = "FamilyTree"; |
55 | 52 | ||
56 | private static final boolean QUERIES = true; | 53 | private static final boolean QUERIES = true; |
57 | 54 | ||
@@ -83,7 +80,7 @@ public class GenerateFromConfig { | |||
83 | final Date date = new Date(_currentTimeMillis); | 80 | final Date date = new Date(_currentTimeMillis); |
84 | final SimpleDateFormat format = new SimpleDateFormat("dd-HHmm"); | 81 | final SimpleDateFormat format = new SimpleDateFormat("dd-HHmm"); |
85 | String _format = format.format(date); | 82 | String _format = format.format(date); |
86 | final String formattedDate = ((GenerateFromConfig.DOMAIN + "-") + _format); | 83 | final String formattedDate = ((GenerateFromConfig.DOMAIN + "/") + _format); |
87 | StringConcatenation _builder = new StringConcatenation(); | 84 | StringConcatenation _builder = new StringConcatenation(); |
88 | _builder.append("output/"); | 85 | _builder.append("output/"); |
89 | String _plus = (_builder.toString() + formattedDate); | 86 | String _plus = (_builder.toString() + formattedDate); |
@@ -145,67 +142,51 @@ public class GenerateFromConfig { | |||
145 | indiv_writer.append(header); | 142 | indiv_writer.append(header); |
146 | } | 143 | } |
147 | InputOutput.println(); | 144 | InputOutput.println(); |
148 | InputOutput.<String>println(((("DOMAIN: " + GenerateFromConfig.DOMAIN) + ", SIZE=") + Integer.valueOf(size))); | 145 | InputOutput.<String>println((((("<<DOMAIN: " + GenerateFromConfig.DOMAIN) + ", SIZE=") + Integer.valueOf(size)) + ">>")); |
149 | for (int i = 0; (i < GenerateFromConfig.REPS); i++) { | 146 | final String outputPath = (((("output/" + formattedDate) + "/size") + Integer.valueOf(size)) + "/models/"); |
150 | { | 147 | final String debugPath = (((("output/" + formattedDate) + "/size") + Integer.valueOf(size)) + "/debug/"); |
151 | InputOutput.<String>print((("<<Run number " + Integer.valueOf(i)) + ">> : ")); | 148 | final String logPath = (debugPath + "log.txt"); |
152 | final ArrayList<Integer> knownIntegers = new ArrayList<Integer>(); | 149 | final String statsPath = (debugPath + "statistics.csv"); |
153 | CollectionExtensions.<Integer>addAll(knownIntegers, Integer.valueOf(0), Integer.valueOf(10), Integer.valueOf(20), Integer.valueOf(30), Integer.valueOf(40), Integer.valueOf(50)); | 150 | Command _get = config.getCommands().get(0); |
154 | final ArrayList<BigDecimal> knownReals = new ArrayList<BigDecimal>(); | 151 | final GenerationTask genTask = ((GenerationTask) _get); |
155 | BigDecimal _bigDecimal = new BigDecimal("0.0"); | 152 | if ((!GenerateFromConfig.QUERIES)) { |
156 | CollectionExtensions.<BigDecimal>addAll(knownReals, _bigDecimal); | 153 | genTask.setPatterns(null); |
157 | final ArrayList<String> knownStrings = new ArrayList<String>(); | ||
158 | CollectionExtensions.<String>addAll(knownStrings, "r0", "r1", "r2", "r3", "r4", "r5", "r6"); | ||
159 | final String outputPath = (((((("output/" + formattedDate) + "/size") + Integer.valueOf(size)) + "/run") + Integer.valueOf(i)) + "/models/"); | ||
160 | final String debugPath = (((((("output/" + formattedDate) + "/size") + Integer.valueOf(size)) + "/run") + Integer.valueOf(i)) + "/debug/"); | ||
161 | final String logPath = (debugPath + "log.txt"); | ||
162 | final String statsPath = (debugPath + "statistics.csv"); | ||
163 | Command _get = config.getCommands().get(0); | ||
164 | final GenerationTask genTask = ((GenerationTask) _get); | ||
165 | if ((!GenerateFromConfig.QUERIES)) { | ||
166 | genTask.setPatterns(null); | ||
167 | } | ||
168 | if ((!GenerateFromConfig.INITIAL)) { | ||
169 | genTask.setPartialModel(null); | ||
170 | } | ||
171 | Scope _scope = genTask.getScope(); | ||
172 | final ScopeSpecification scopeSpec = ((ScopeSpecification) _scope); | ||
173 | TypeScope _get_1 = scopeSpec.getScopes().get(0); | ||
174 | final ObjectTypeScope objScope = ((ObjectTypeScope) _get_1); | ||
175 | NumberSpecification _number = objScope.getNumber(); | ||
176 | final IntervallNumber interval = ((IntervallNumber) _number); | ||
177 | interval.setMin(size); | ||
178 | interval.setMaxUnlimited(true); | ||
179 | Config _config = genTask.getConfig(); | ||
180 | final ConfigSpecification configScope = ((ConfigSpecification) _config); | ||
181 | ConfigEntry _get_2 = configScope.getEntries().get(0); | ||
182 | final RuntimeEntry runtimeEntry = ((RuntimeEntry) _get_2); | ||
183 | runtimeEntry.setMillisecLimit(GenerateFromConfig.RUNTIME); | ||
184 | File _debugFolder = genTask.getDebugFolder(); | ||
185 | final FileSpecification debug = ((FileSpecification) _debugFolder); | ||
186 | debug.setPath(debugPath); | ||
187 | File _tagetFolder = genTask.getTagetFolder(); | ||
188 | final FileSpecification output = ((FileSpecification) _tagetFolder); | ||
189 | output.setPath(outputPath); | ||
190 | File _targetLogFile = genTask.getTargetLogFile(); | ||
191 | final FileSpecification log = ((FileSpecification) _targetLogFile); | ||
192 | log.setPath(logPath); | ||
193 | File _targetStatisticsFile = genTask.getTargetStatisticsFile(); | ||
194 | final FileSpecification stats = ((FileSpecification) _targetStatisticsFile); | ||
195 | stats.setPath(statsPath); | ||
196 | final long startTime = System.currentTimeMillis(); | ||
197 | NullProgressMonitor _nullProgressMonitor = new NullProgressMonitor(); | ||
198 | executor.executeScript(config, _nullProgressMonitor); | ||
199 | long _currentTimeMillis_1 = System.currentTimeMillis(); | ||
200 | final long measuredTime = (_currentTimeMillis_1 - startTime); | ||
201 | InputOutput.<String>println((("<<END ->" + Double.valueOf((measuredTime / 1000.0))) + "s >>\n")); | ||
202 | final Runtime r = Runtime.getRuntime(); | ||
203 | r.gc(); | ||
204 | r.gc(); | ||
205 | r.gc(); | ||
206 | Thread.sleep(3000); | ||
207 | } | ||
208 | } | 154 | } |
155 | if ((!GenerateFromConfig.INITIAL)) { | ||
156 | genTask.setPartialModel(null); | ||
157 | } | ||
158 | genTask.setRuns(GenerateFromConfig.REPS); | ||
159 | Scope _scope = genTask.getScope(); | ||
160 | final ScopeSpecification scopeSpec = ((ScopeSpecification) _scope); | ||
161 | TypeScope _get_1 = scopeSpec.getScopes().get(0); | ||
162 | final ObjectTypeScope objScope = ((ObjectTypeScope) _get_1); | ||
163 | NumberSpecification _number = objScope.getNumber(); | ||
164 | final IntervallNumber interval = ((IntervallNumber) _number); | ||
165 | interval.setMin(size); | ||
166 | interval.setMaxUnlimited(true); | ||
167 | Config _config = genTask.getConfig(); | ||
168 | final ConfigSpecification configScope = ((ConfigSpecification) _config); | ||
169 | ConfigEntry _get_2 = configScope.getEntries().get(0); | ||
170 | final RuntimeEntry runtimeEntry = ((RuntimeEntry) _get_2); | ||
171 | runtimeEntry.setMillisecLimit(GenerateFromConfig.RUNTIME); | ||
172 | File _debugFolder = genTask.getDebugFolder(); | ||
173 | final FileSpecification debug = ((FileSpecification) _debugFolder); | ||
174 | debug.setPath(debugPath); | ||
175 | File _tagetFolder = genTask.getTagetFolder(); | ||
176 | final FileSpecification output = ((FileSpecification) _tagetFolder); | ||
177 | output.setPath(outputPath); | ||
178 | File _targetLogFile = genTask.getTargetLogFile(); | ||
179 | final FileSpecification log = ((FileSpecification) _targetLogFile); | ||
180 | log.setPath(logPath); | ||
181 | File _targetStatisticsFile = genTask.getTargetStatisticsFile(); | ||
182 | final FileSpecification stats = ((FileSpecification) _targetStatisticsFile); | ||
183 | stats.setPath(statsPath); | ||
184 | final long startTime = System.currentTimeMillis(); | ||
185 | NullProgressMonitor _nullProgressMonitor = new NullProgressMonitor(); | ||
186 | executor.executeScript(config, _nullProgressMonitor); | ||
187 | long _currentTimeMillis_1 = System.currentTimeMillis(); | ||
188 | final long measuredTime = (_currentTimeMillis_1 - startTime); | ||
189 | InputOutput.<String>println((("<<END ->" + Double.valueOf((measuredTime / 1000.0))) + "s >>\n")); | ||
209 | if (GenerateFromConfig.INDIV_WRT) { | 190 | if (GenerateFromConfig.INDIV_WRT) { |
210 | indiv_writer.close(); | 191 | indiv_writer.close(); |
211 | } | 192 | } |