diff options
author | 2019-10-29 16:40:23 +0100 | |
---|---|---|
committer | 2019-10-29 16:40:23 +0100 | |
commit | d46494bb753225652f48e42f47411297693a03ab (patch) | |
tree | f7a156caa871eb5c59b4960d0ce7fbbb4adefe72 /Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotAllocatedAppInstancesConstraint.xtend | |
parent | Merge remote-tracking branch 'origin/master' into kris (diff) | |
download | VIATRA-Generator-d46494bb753225652f48e42f47411297693a03ab.tar.gz VIATRA-Generator-d46494bb753225652f48e42f47411297693a03ab.tar.zst VIATRA-Generator-d46494bb753225652f48e42f47411297693a03ab.zip |
Remove MDEOptimiser dependency
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotAllocatedAppInstancesConstraint.xtend')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotAllocatedAppInstancesConstraint.xtend | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotAllocatedAppInstancesConstraint.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotAllocatedAppInstancesConstraint.xtend deleted file mode 100644 index 663aa26c..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotAllocatedAppInstancesConstraint.xtend +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
4 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.IGuidanceFunction | ||
5 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.interpreter.guidance.Solution | ||
6 | |||
7 | class NotAllocatedAppInstancesConstraint implements IGuidanceFunction { | ||
8 | override getName() { | ||
9 | "NotAllocatedAppInstances" | ||
10 | } | ||
11 | |||
12 | override computeFitness(Solution solution) { | ||
13 | val cps = solution.model as CyberPhysicalSystem | ||
14 | var int cost = 0 | ||
15 | for (appType : cps.applicationTypes) { | ||
16 | for (app : appType.instances) { | ||
17 | if (app.allocatedTo === null || !appType.requirements.exists[hostType == app.allocatedTo.type]) { | ||
18 | cost++ | ||
19 | } | ||
20 | } | ||
21 | } | ||
22 | cost | ||
23 | } | ||
24 | } | ||