aboutsummaryrefslogtreecommitdiffstats
path: root/Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/RunGeneratorConfig.xtend
diff options
context:
space:
mode:
authorLibravatar ArenBabikian <aren.babikian@mail.mcgill.ca>2020-05-13 11:35:08 -0400
committerLibravatar ArenBabikian <aren.babikian@mail.mcgill.ca>2020-05-13 11:35:08 -0400
commitc28b680ed70fa9445a25c4921887940b099511d5 (patch)
treebdbbd7bd520f35a1d5c207dd23b4c8b930852a1f /Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/RunGeneratorConfig.xtend
parentupper limit is soft (diff)
downloadVIATRA-Generator-c28b680ed70fa9445a25c4921887940b099511d5.tar.gz
VIATRA-Generator-c28b680ed70fa9445a25c4921887940b099511d5.tar.zst
VIATRA-Generator-c28b680ed70fa9445a25c4921887940b099511d5.zip
Add measurements, generate new jar that allows upper limit (w/o viz)
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/RunGeneratorConfig.xtend')
-rw-r--r--Tests/MODELS2020-CaseStudies/case.study.pledge.run/src/run/RunGeneratorConfig.xtend32
1 files changed, 21 insertions, 11 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 c2ad68f5..c1925786 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
@@ -22,7 +22,8 @@ import org.eclipse.core.runtime.NullProgressMonitor
22import org.apache.commons.cli.BasicParser 22import org.apache.commons.cli.BasicParser
23 23
24class RunGeneratorConfig { 24class RunGeneratorConfig {
25 static var SIZE = 20 25 static var SIZE_LB = 20
26 static var SIZE_UB = -1
26 27
27 static var RUNS = 10 28 static var RUNS = 10
28 static var RUNTIME = 600 29 static var RUNTIME = 600
@@ -35,8 +36,11 @@ class RunGeneratorConfig {
35 36
36 val options = new Options() 37 val options = new Options()
37 38
38 val s = new Option("s", "size", true, "generated model Lower bound") 39 val lb = new Option("lb", "lowerBound", true, "generated model Lower bound")
39 options.addOption(s) 40 options.addOption(lb)
41
42 val ub = new Option("ub", "upperBound", true, "generated model Upper bound")
43 options.addOption(ub)
40 44
41 val n = new Option("n", "numRuns", true, "number of runs") 45 val n = new Option("n", "numRuns", true, "number of runs")
42 options.addOption(n) 46 options.addOption(n)
@@ -59,8 +63,10 @@ class RunGeneratorConfig {
59 System.exit(1) 63 System.exit(1)
60 } 64 }
61 65
62 val sIn = cmd.getOptionValue("size") 66 val lbIn = cmd.getOptionValue("lowerBound")
63 if(sIn !== null) SIZE = Integer.parseInt(sIn) 67 if(lbIn !== null) SIZE_LB = Integer.parseInt(lbIn)
68 val ubIn = cmd.getOptionValue("upperBound")
69 if(ubIn !== null) SIZE_UB = Integer.parseInt(ubIn)
64 val nIn = cmd.getOptionValue("numRuns") 70 val nIn = cmd.getOptionValue("numRuns")
65 if(nIn !== null) RUNS = Integer.parseInt(nIn) 71 if(nIn !== null) RUNS = Integer.parseInt(nIn)
66 val rtIn = cmd.getOptionValue("runtime") 72 val rtIn = cmd.getOptionValue("runtime")
@@ -79,12 +85,12 @@ class RunGeneratorConfig {
79 85
80 // ///////////////////////// 86 // /////////////////////////
81 // BEGIN RUN 87 // BEGIN RUN
82 println("<<DOMAIN: " + DOMAIN + ", SIZE=" + SIZE + ",Runs=" + RUNS + ",Runtime=" + RUNTIME+">>\n") 88 println("<<DOMAIN: " + DOMAIN + ", SIZE=" + SIZE_LB + "to" + SIZE_UB + ", Runs=" + RUNS + ", Runtime=" + RUNTIME+">>\n")
83 89
84 val outputPath = "measurements/" + "models/"+ DOMAIN + "/size" + SIZE + "_" + formattedDate 90 val outputPath = "measurements/" + "models/"+ DOMAIN + "/size" + SIZE_LB + "to" + SIZE_UB + "_" + formattedDate
85 val debugPath = "measurements/" + "debug/" + DOMAIN + "/size" + SIZE + "_" + formattedDate 91 val debugPath = "measurements/" + "debug/" + DOMAIN + "/size" + SIZE_LB + "to" + SIZE_UB + "_" + formattedDate
86 val logPath = debugPath + "/log.txt" 92 val logPath = debugPath + "/log.txt"
87 val statsPath = "measurements/" + "stats/" + DOMAIN + "/size" + SIZE + "x" + RUNS + "stats_" + formattedDate + ".csv" 93 val statsPath = "measurements/" + "stats/" + DOMAIN + "/size" + SIZE_LB + "to" + SIZE_UB + "x" + RUNS + "stats_" + formattedDate + ".csv"
88 94
89 // Basic Adjustments 95 // Basic Adjustments
90 val genTask = config.commands.get(1) as GenerationTask 96 val genTask = config.commands.get(1) as GenerationTask
@@ -96,8 +102,12 @@ class RunGeneratorConfig {
96 val scopeSpec = genTask.scope as ScopeSpecification 102 val scopeSpec = genTask.scope as ScopeSpecification
97 val objScope = scopeSpec.scopes.get(0) as ObjectTypeScope 103 val objScope = scopeSpec.scopes.get(0) as ObjectTypeScope
98 val interval = objScope.number as IntervallNumber 104 val interval = objScope.number as IntervallNumber
99 interval.min = SIZE 105 interval.min = SIZE_LB
100 interval.maxUnlimited = true 106 if(SIZE_UB == -1) interval.maxUnlimited = true
107 else {
108 interval.maxUnlimited = false
109 interval.maxNumber = SIZE_UB
110 }
101 111
102 // Runtime 112 // Runtime
103 val configScope = genTask.config as ConfigSpecification 113 val configScope = genTask.config as ConfigSpecification