diff options
author | 2019-08-01 18:38:15 +0200 | |
---|---|---|
committer | 2019-08-01 18:38:15 +0200 | |
commit | 6eb760ee960cd3efe51ca6e4107153c09838a1da (patch) | |
tree | 2edd0e21be50265f65f0cfd2fd43f18a252aef02 /Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TotalCostFitnessFunction.java | |
parent | Dump required Xbase version down to 2.17 (diff) | |
download | VIATRA-Generator-6eb760ee960cd3efe51ca6e4107153c09838a1da.tar.gz VIATRA-Generator-6eb760ee960cd3efe51ca6e4107153c09838a1da.tar.zst VIATRA-Generator-6eb760ee960cd3efe51ca6e4107153c09838a1da.zip |
Clean up CPS and Satellite domains
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TotalCostFitnessFunction.java')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TotalCostFitnessFunction.java | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TotalCostFitnessFunction.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TotalCostFitnessFunction.java deleted file mode 100644 index 7bb80ca8..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TotalCostFitnessFunction.java +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo; | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; | ||
4 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; | ||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; | ||
6 | import org.eclipse.emf.common.util.EList; | ||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.IGuidanceFunction; | ||
9 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.interpreter.guidance.Solution; | ||
10 | |||
11 | @SuppressWarnings("all") | ||
12 | public class TotalCostFitnessFunction implements IGuidanceFunction { | ||
13 | @Override | ||
14 | public String getName() { | ||
15 | return "TotalCost"; | ||
16 | } | ||
17 | |||
18 | @Override | ||
19 | public double computeFitness(final Solution solution) { | ||
20 | int _xblockexpression = (int) 0; | ||
21 | { | ||
22 | EObject _model = solution.getModel(); | ||
23 | final CyberPhysicalSystem cps = ((CyberPhysicalSystem) _model); | ||
24 | int cost = 0; | ||
25 | EList<ApplicationType> _applicationTypes = cps.getApplicationTypes(); | ||
26 | for (final ApplicationType appType : _applicationTypes) { | ||
27 | int _cost = cost; | ||
28 | int _size = appType.getInstances().size(); | ||
29 | int _multiply = (5 * _size); | ||
30 | cost = (_cost + _multiply); | ||
31 | } | ||
32 | EList<HostType> _hostTypes = cps.getHostTypes(); | ||
33 | for (final HostType hostType : _hostTypes) { | ||
34 | int _cost_1 = cost; | ||
35 | int _cost_2 = hostType.getCost(); | ||
36 | int _size_1 = hostType.getInstances().size(); | ||
37 | int _multiply_1 = (_cost_2 * _size_1); | ||
38 | cost = (_cost_1 + _multiply_1); | ||
39 | } | ||
40 | _xblockexpression = cost; | ||
41 | } | ||
42 | return _xblockexpression; | ||
43 | } | ||
44 | } | ||