aboutsummaryrefslogtreecommitdiffstats
path: root/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <marussy@mit.bme.hu>2020-06-23 15:16:27 +0200
committerLibravatar Kristóf Marussy <marussy@mit.bme.hu>2020-06-23 15:16:27 +0200
commitf9c646d97400741b1fb2863668ea68de0c4f18b7 (patch)
tree783983f3217f006d9acde59b1cf007059a73f9d4 /Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run
parentFix numeric-solver-at-end (diff)
downloadVIATRA-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.xtend32
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
12import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ScopeSpecification 12import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ScopeSpecification
13import hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor 13import hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor
14import hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor 14import hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor
15import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace 15import java.io.File
16import java.text.SimpleDateFormat 16import java.text.SimpleDateFormat
17import java.util.Date 17import java.util.Date
18import org.apache.commons.cli.BasicParser 18import org.apache.commons.cli.BasicParser
@@ -23,8 +23,8 @@ import org.apache.commons.cli.Option
23import org.apache.commons.cli.Options 23import org.apache.commons.cli.Options
24import org.apache.commons.cli.ParseException 24import org.apache.commons.cli.ParseException
25import org.eclipse.core.runtime.NullProgressMonitor 25import org.eclipse.core.runtime.NullProgressMonitor
26import org.eclipse.emf.ecore.resource.Resource 26import com.google.common.io.Files
27import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl 27import java.io.PrintWriter
28 28
29class RunGeneratorConfig { 29class 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)