source: DCWoRMS/branches/coolemall/src/test/fips/models/xeon/TangCoolingDeviceEnergyEstimationPlugin.java @ 1600

Revision 1600, 1.8 KB checked in by wojtekp, 8 years ago (diff)
  • Property svn:mime-type set to text/plain
Line 
1package test.fips.models.xeon;
2
3import schedframe.resources.computing.ComputingResource;
4import schedframe.resources.computing.Rack;
5import schedframe.resources.computing.profiles.energy.ResourceEvent;
6import schedframe.resources.devices.Device;
7import schedframe.resources.devices.PhysicalResource;
8import schedframe.scheduling.manager.tasks.JobRegistry;
9import simulator.ConfigurationOptions;
10import example.energy.BaseEnergyEstimationPlugin;
11import test.fips.EnvironmentConditions;
12
13public class TangCoolingDeviceEnergyEstimationPlugin extends BaseEnergyEstimationPlugin {
14
15        public double estimateAirflow(ResourceEvent event, JobRegistry jobRegistry, PhysicalResource resource) {
16                double airflow = 0;
17                return airflow;
18        }
19
20        public double estimatePowerConsumption(ResourceEvent event, JobRegistry jobRegistry,
21                        PhysicalResource resource) {
22               
23                double powerConsumption = 0;
24               
25                Device coolingDevice = (Device) resource;
26                ComputingResource room = (ComputingResource) coolingDevice.getComputingResource();
27               
28                double Pload_dc = calculatePit(room);
29                double Pothers = calculatePothers(Pload_dc);
30                double airTemp = EnvironmentConditions.ROOM_TEMPERATURE;
31                double CoP = 0.0068 * Math.pow(airTemp, 2) + 0.0008 * airTemp + 0.458;
32               
33                powerConsumption =  (Pload_dc + Pothers)/CoP;
34                return powerConsumption;
35        }
36       
37        private double calculatePit(ComputingResource room){
38                double Pload_dc = 0;
39                for(ComputingResource cr: room.getChildren()){
40                        Rack rack = (Rack)cr;
41                        Pload_dc = Pload_dc + rack.getPowerInterface().getRecentPowerUsage().getValue();
42                }
43                return Pload_dc;
44        }
45        private double calculatePothers(double Pload_dc){
46               
47                double Pothers = 0;
48               
49                double a;//experiment
50                try{
51                        a = ConfigurationOptions.coolingData.getAlpha();
52                } catch (Exception e){
53                        a = 0.02;
54                }
55
56                Pothers = a * Pload_dc;
57                return Pothers;
58        }
59
60}
Note: See TracBrowser for help on using the repository browser.