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/NotSatisfiedRequirementsConstraint.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/NotSatisfiedRequirementsConstraint.java')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotSatisfiedRequirementsConstraint.java | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotSatisfiedRequirementsConstraint.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotSatisfiedRequirementsConstraint.java deleted file mode 100644 index 34f73952..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotSatisfiedRequirementsConstraint.java +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo; | ||
2 | |||
3 | import com.google.common.base.Objects; | ||
4 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.Request; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; | ||
9 | import org.eclipse.emf.common.util.EList; | ||
10 | import org.eclipse.emf.ecore.EObject; | ||
11 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.IGuidanceFunction; | ||
12 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.interpreter.guidance.Solution; | ||
13 | |||
14 | @SuppressWarnings("all") | ||
15 | public class NotSatisfiedRequirementsConstraint implements IGuidanceFunction { | ||
16 | @Override | ||
17 | public String getName() { | ||
18 | return "NotSatisfiedRequirements"; | ||
19 | } | ||
20 | |||
21 | @Override | ||
22 | public double computeFitness(final Solution solution) { | ||
23 | int _xblockexpression = (int) 0; | ||
24 | { | ||
25 | EObject _model = solution.getModel(); | ||
26 | final CyberPhysicalSystem cps = ((CyberPhysicalSystem) _model); | ||
27 | int cost = 0; | ||
28 | EList<Request> _requests = cps.getRequests(); | ||
29 | for (final Request request : _requests) { | ||
30 | EList<Requirement> _requirements = request.getRequirements(); | ||
31 | for (final Requirement requirement : _requirements) { | ||
32 | { | ||
33 | int _cost = cost; | ||
34 | int _count = requirement.getCount(); | ||
35 | int _size = requirement.getInstances().size(); | ||
36 | int _minus = (_count - _size); | ||
37 | int _abs = Math.abs(_minus); | ||
38 | cost = (_cost + _abs); | ||
39 | EList<ApplicationInstance> _instances = requirement.getInstances(); | ||
40 | for (final ApplicationInstance app : _instances) { | ||
41 | ApplicationType _type = app.getType(); | ||
42 | ApplicationType _type_1 = requirement.getType(); | ||
43 | boolean _notEquals = (!Objects.equal(_type, _type_1)); | ||
44 | if (_notEquals) { | ||
45 | cost++; | ||
46 | } | ||
47 | } | ||
48 | } | ||
49 | } | ||
50 | } | ||
51 | _xblockexpression = cost; | ||
52 | } | ||
53 | return _xblockexpression; | ||
54 | } | ||
55 | } | ||