diff options
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator')
2 files changed, 23 insertions, 0 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/.CpsGenerator.xtendbin b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/.CpsGenerator.xtendbin index 306f031b..a46b8a8e 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/.CpsGenerator.xtendbin +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/.CpsGenerator.xtendbin | |||
Binary files differ | |||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.java index e59ef004..ce0cd02d 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.java | |||
@@ -1,5 +1,6 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.generator; | 1 | package hu.bme.mit.inf.dslreasoner.domains.cps.generator; |
2 | 2 | ||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; | 4 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; |
4 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsFactory; | 5 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsFactory; |
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; | 6 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; |
@@ -17,6 +18,7 @@ import org.eclipse.emf.ecore.EObject; | |||
17 | import org.eclipse.emf.ecore.resource.Resource; | 18 | import org.eclipse.emf.ecore.resource.Resource; |
18 | import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; | 19 | import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; |
19 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; | 20 | import org.eclipse.xtext.xbase.lib.CollectionLiterals; |
21 | import org.eclipse.xtext.xbase.lib.ExclusiveRange; | ||
20 | import org.eclipse.xtext.xbase.lib.Extension; | 22 | import org.eclipse.xtext.xbase.lib.Extension; |
21 | import org.eclipse.xtext.xbase.lib.ObjectExtensions; | 23 | import org.eclipse.xtext.xbase.lib.ObjectExtensions; |
22 | import org.eclipse.xtext.xbase.lib.Procedures.Procedure1; | 24 | import org.eclipse.xtext.xbase.lib.Procedures.Procedure1; |
@@ -46,11 +48,18 @@ public class CpsGenerator { | |||
46 | 48 | ||
47 | private final int demandFactor; | 49 | private final int demandFactor; |
48 | 50 | ||
51 | private final boolean populateAppInstances; | ||
52 | |||
49 | public CpsGenerator(final long randomSeed, final int applicationTypeCount, final int demandFactor) { | 53 | public CpsGenerator(final long randomSeed, final int applicationTypeCount, final int demandFactor) { |
54 | this(randomSeed, applicationTypeCount, demandFactor, false); | ||
55 | } | ||
56 | |||
57 | public CpsGenerator(final long randomSeed, final int applicationTypeCount, final int demandFactor, final boolean populateAppInstances) { | ||
50 | Random _random = new Random(randomSeed); | 58 | Random _random = new Random(randomSeed); |
51 | this.random = _random; | 59 | this.random = _random; |
52 | this.applicationTypeCount = applicationTypeCount; | 60 | this.applicationTypeCount = applicationTypeCount; |
53 | this.demandFactor = demandFactor; | 61 | this.demandFactor = demandFactor; |
62 | this.populateAppInstances = populateAppInstances; | ||
54 | } | 63 | } |
55 | 64 | ||
56 | public CyberPhysicalSystem generateCpsProblem() { | 65 | public CyberPhysicalSystem generateCpsProblem() { |
@@ -83,6 +92,20 @@ public class CpsGenerator { | |||
83 | final Procedure1<Requirement> _function_2 = (Requirement it_2) -> { | 92 | final Procedure1<Requirement> _function_2 = (Requirement it_2) -> { |
84 | it_2.setCount(this.nextInt(CpsGenerator.MIN_REPLICAS, CpsGenerator.MAX_REPLICAS)); | 93 | it_2.setCount(this.nextInt(CpsGenerator.MIN_REPLICAS, CpsGenerator.MAX_REPLICAS)); |
85 | it_2.setType(appType); | 94 | it_2.setType(appType); |
95 | if (this.populateAppInstances) { | ||
96 | int _count = it_2.getCount(); | ||
97 | ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _count, true); | ||
98 | for (final Integer j : _doubleDotLessThan) { | ||
99 | { | ||
100 | final ApplicationInstance app = this._cpsFactory.createApplicationInstance(); | ||
101 | app.setType(appType); | ||
102 | EList<ApplicationInstance> _instances = appType.getInstances(); | ||
103 | _instances.add(app); | ||
104 | EList<ApplicationInstance> _instances_1 = it_2.getInstances(); | ||
105 | _instances_1.add(app); | ||
106 | } | ||
107 | } | ||
108 | } | ||
86 | }; | 109 | }; |
87 | Requirement _doubleArrow = ObjectExtensions.<Requirement>operator_doubleArrow(_createRequirement, _function_2); | 110 | Requirement _doubleArrow = ObjectExtensions.<Requirement>operator_doubleArrow(_createRequirement, _function_2); |
88 | _requirements.add(_doubleArrow); | 111 | _requirements.add(_doubleArrow); |