1 | package de.uka.ipd.sdq.dsexplore.opt4j.optimizer.heuristic.operators.impl; |
2 | import org.apache.log4j.Logger; |
3 | import de.uka.ipd.sdq.pcm.allocation.AllocationContext; |
4 | import de.uka.ipd.sdq.pcm.repository.BasicComponent; |
5 | import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceContainer; |
6 | |
7 | public class CompInfoResDemand { |
8 | |
9 | protected static Logger logger = Logger.getLogger(CompInfoResDemand.class.getName()); |
10 | |
11 | //basic component |
12 | BasicComponent bc; |
13 | |
14 | //allocation context of the component |
15 | AllocationContext ac; |
16 | |
17 | //resource container on which the component is deployed |
18 | ResourceContainer rc; |
19 | |
20 | //amount of CPU demand |
21 | double computation; |
22 | |
23 | //amount of HDD demand |
24 | double storage; |
25 | |
26 | //initial values |
27 | public CompInfoResDemand(){ |
28 | this.bc = null; |
29 | this.ac = null; |
30 | this.rc = null; |
31 | this.computation = 0.0; |
32 | this.storage = 0.0; |
33 | } |
34 | |
35 | public CompInfoResDemand(BasicComponent bc, AllocationContext ac, ResourceContainer rc, double c, double s){ |
36 | this.bc = bc; |
37 | this.ac = ac; |
38 | this.rc = rc; |
39 | this.computation = c; |
40 | this.storage = s; |
41 | } |
42 | |
43 | public CompInfoResDemand(CompInfoResDemand c){ |
44 | this.bc = c.bc; |
45 | this.ac = c.ac; |
46 | this.rc = c.rc; |
47 | this.computation = c.computation; |
48 | this.storage = c.storage; |
49 | } |
50 | |
51 | //print elements of CompInfoResDemand type |
52 | public void print(){ |
53 | logger.info("BC " + this.bc.getEntityName() + "," + |
54 | " RC " + this.rc.getEntityName() + "," + |
55 | " CpuDemand " + this.computation + "," + |
56 | " HddDemand " + this.storage); |
57 | } |
58 | |
59 | } |