diff options
author | Kristóf Marussy <marussy@mit.bme.hu> | 2020-06-23 15:16:27 +0200 |
---|---|---|
committer | Kristóf Marussy <marussy@mit.bme.hu> | 2020-06-23 15:16:27 +0200 |
commit | f9c646d97400741b1fb2863668ea68de0c4f18b7 (patch) | |
tree | 783983f3217f006d9acde59b1cf007059a73f9d4 /Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run | |
parent | Fix numeric-solver-at-end (diff) | |
download | VIATRA-Generator-f9c646d97400741b1fb2863668ea68de0c4f18b7.tar.gz VIATRA-Generator-f9c646d97400741b1fb2863668ea68de0c4f18b7.tar.zst VIATRA-Generator-f9c646d97400741b1fb2863668ea68de0c4f18b7.zip |
Measurements framework fixes
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run')
-rw-r--r-- | Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/RunGeneratorConfig.xtend | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/RunGeneratorConfig.xtend b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/RunGeneratorConfig.xtend index c84f55d3..20eed2e2 100644 --- a/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/RunGeneratorConfig.xtend +++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/RunGeneratorConfig.xtend | |||
@@ -12,7 +12,7 @@ import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.RuntimeEn | |||
12 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ScopeSpecification | 12 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ScopeSpecification |
13 | import hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor | 13 | import hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor |
14 | import hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor | 14 | import hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor |
15 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace | 15 | import java.io.File |
16 | import java.text.SimpleDateFormat | 16 | import java.text.SimpleDateFormat |
17 | import java.util.Date | 17 | import java.util.Date |
18 | import org.apache.commons.cli.BasicParser | 18 | import org.apache.commons.cli.BasicParser |
@@ -23,8 +23,8 @@ import org.apache.commons.cli.Option | |||
23 | import org.apache.commons.cli.Options | 23 | import org.apache.commons.cli.Options |
24 | import org.apache.commons.cli.ParseException | 24 | import org.apache.commons.cli.ParseException |
25 | import org.eclipse.core.runtime.NullProgressMonitor | 25 | import org.eclipse.core.runtime.NullProgressMonitor |
26 | import org.eclipse.emf.ecore.resource.Resource | 26 | import com.google.common.io.Files |
27 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl | 27 | import java.io.PrintWriter |
28 | 28 | ||
29 | class RunGeneratorConfig { | 29 | class RunGeneratorConfig { |
30 | static var SIZE_LB = 20 | 30 | static var SIZE_LB = 20 |
@@ -40,6 +40,8 @@ class RunGeneratorConfig { | |||
40 | static val INITIAL = true | 40 | static val INITIAL = true |
41 | 41 | ||
42 | def static void main(String[] args) { | 42 | def static void main(String[] args) { |
43 | // MyChangeFactory.install() | ||
44 | |||
43 | // Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put("xmi", new XMIResourceFactoryImpl) | 45 | // Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put("xmi", new XMIResourceFactoryImpl) |
44 | // val workspace = new FileSystemWorkspace('''x/''', "") | 46 | // val workspace = new FileSystemWorkspace('''x/''', "") |
45 | // workspace.initAndClear | 47 | // workspace.initAndClear |
@@ -142,7 +144,29 @@ class RunGeneratorConfig { | |||
142 | val pms = genTask.partialModel as PartialModelSpecification | 144 | val pms = genTask.partialModel as PartialModelSpecification |
143 | val me = pms.entry.get(0) as ModelEntry | 145 | val me = pms.entry.get(0) as ModelEntry |
144 | val fs = me.path as FileSpecification | 146 | val fs = me.path as FileSpecification |
145 | fs.path = "inputs/Resource" + HOUSEHOLD + "hh.xmi" | 147 | val modelPath = "inputs/Resource" + HOUSEHOLD + "hh.xmi" |
148 | val modelFile = new File(modelPath) | ||
149 | if (!modelFile.exists) { | ||
150 | val writer = new PrintWriter(modelFile) | ||
151 | try { | ||
152 | writer.println(''' | ||
153 | <?xml version="1.0" encoding="UTF-8"?> | ||
154 | <TaxCardWithRoot:Resource | ||
155 | xmi:version="2.0" | ||
156 | xmlns:xmi="http://www.omg.org/XMI" | ||
157 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
158 | xmlns:TaxCardWithRoot="http:///TaxCardWithRoot.ecore" | ||
159 | xsi:schemaLocation="http:///TaxCardWithRoot.ecore ../../case.study.pledge.model/model/TaxationWithRoot.ecore"> | ||
160 | «FOR i : 0 ..< HOUSEHOLD» | ||
161 | <contains/> | ||
162 | «ENDFOR» | ||
163 | </TaxCardWithRoot:Resource> | ||
164 | ''') | ||
165 | } finally { | ||
166 | writer.close | ||
167 | } | ||
168 | } | ||
169 | fs.path = modelPath | ||
146 | println("<<Using " + fs.path + " as initial model>>") | 170 | println("<<Using " + fs.path + " as initial model>>") |
147 | } else { | 171 | } else { |
148 | scopeSpec.scopes.remove(1) | 172 | scopeSpec.scopes.remove(1) |