1 | package de.uka.ipd.sdq.dsexplore.opt4j.optimizer.heuristic.operators.impl; |
2 | |
3 | import org.apache.log4j.Logger; |
4 | |
5 | import de.uka.ipd.sdq.pcm.resourceenvironment.ResourceContainer; |
6 | import de.uka.ipd.sdq.pcm.resourcetype.ProcessingResourceType; |
7 | |
8 | public class ActiveResInfo { |
9 | |
10 | protected static Logger logger = Logger.getLogger(ActiveResInfo.class.getName()); |
11 | |
12 | //resource container of the hardware resource |
13 | ResourceContainer rc; |
14 | |
15 | //type of hardware resource |
16 | ProcessingResourceType type; |
17 | |
18 | //LQN solution - utilisation of the hardware resource |
19 | double utilisation; |
20 | |
21 | //LQN solution - queue length of the hardware resource |
22 | double queueLength; |
23 | |
24 | //scheduling policy |
25 | String schedulingPolicy; |
26 | |
27 | //initial values |
28 | public ActiveResInfo(){ |
29 | this.rc = null; |
30 | this.type = null; |
31 | this.utilisation = 0.0; |
32 | this.queueLength = 0.0; |
33 | this.schedulingPolicy = ""; |
34 | } |
35 | |
36 | public ActiveResInfo(ResourceContainer rc, ProcessingResourceType processingResourceType, double u, double q, String s){ |
37 | this.rc = rc; |
38 | this.type = processingResourceType; |
39 | this.utilisation = u; |
40 | this.queueLength = q; |
41 | this.schedulingPolicy = s; |
42 | } |
43 | |
44 | public ActiveResInfo(ActiveResInfo h){ |
45 | this.rc = h.rc; |
46 | this.type = h.type; |
47 | this.utilisation = h.utilisation; |
48 | this.queueLength = h.queueLength; |
49 | this.schedulingPolicy = h.schedulingPolicy; |
50 | } |
51 | |
52 | //print elements of ActiveResInfo type |
53 | public void print(){ |
54 | logger.info("ActiveRes " + this.rc.getEntityName() + ","+ |
55 | " type " + this.type.getEntityName() + ","+ |
56 | " U: " + this.utilisation + ","+ |
57 | " QL: " + this.queueLength + ","+ |
58 | " scheduling " + this.schedulingPolicy); |
59 | } |
60 | |
61 | } |