diff options
author | 2019-05-25 15:00:10 -0400 | |
---|---|---|
committer | 2019-05-25 15:00:10 -0400 | |
commit | 89fe6051866933495237f0c733147700275b9549 (patch) | |
tree | fee5157ef3a68af17aac1a8bdfbf7cfa50240e23 /Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.xtend | |
parent | MDEOptimiser implementation of CPS benchmark (diff) | |
download | VIATRA-Generator-89fe6051866933495237f0c733147700275b9549.tar.gz VIATRA-Generator-89fe6051866933495237f0c733147700275b9549.tar.zst VIATRA-Generator-89fe6051866933495237f0c733147700275b9549.zip |
MDEOptimiser tuning for CPS
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.xtend')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.xtend | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.xtend index 390d13d3..e8d29949 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.xtend +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.xtend | |||
@@ -22,11 +22,17 @@ class CpsGenerator { | |||
22 | val Random random | 22 | val Random random |
23 | val int applicationTypeCount | 23 | val int applicationTypeCount |
24 | val int demandFactor | 24 | val int demandFactor |
25 | val boolean populateAppInstances | ||
25 | 26 | ||
26 | new(long randomSeed, int applicationTypeCount, int demandFactor) { | 27 | new(long randomSeed, int applicationTypeCount, int demandFactor) { |
28 | this(randomSeed, applicationTypeCount, demandFactor, false) | ||
29 | } | ||
30 | |||
31 | new(long randomSeed, int applicationTypeCount, int demandFactor, boolean populateAppInstances) { | ||
27 | this.random = new Random(randomSeed) | 32 | this.random = new Random(randomSeed) |
28 | this.applicationTypeCount = applicationTypeCount | 33 | this.applicationTypeCount = applicationTypeCount |
29 | this.demandFactor = demandFactor | 34 | this.demandFactor = demandFactor |
35 | this.populateAppInstances = populateAppInstances | ||
30 | } | 36 | } |
31 | 37 | ||
32 | def generateCpsProblem() { | 38 | def generateCpsProblem() { |
@@ -50,6 +56,14 @@ class CpsGenerator { | |||
50 | requirements += createRequirement => [ | 56 | requirements += createRequirement => [ |
51 | count = nextInt(CpsGenerator.MIN_REPLICAS, CpsGenerator.MAX_REPLICAS) | 57 | count = nextInt(CpsGenerator.MIN_REPLICAS, CpsGenerator.MAX_REPLICAS) |
52 | type = appType | 58 | type = appType |
59 | if (populateAppInstances) { | ||
60 | for (j : 0 ..< count) { | ||
61 | val app = createApplicationInstance | ||
62 | app.type = appType | ||
63 | appType.instances += app | ||
64 | instances += app | ||
65 | } | ||
66 | } | ||
53 | ] | 67 | ] |
54 | } | 68 | } |
55 | ] | 69 | ] |