package test.fips.models.xeon_fpga; import schedframe.resources.computing.ComputingResource; import schedframe.resources.computing.Rack; import schedframe.resources.computing.profiles.energy.ResourceEvent; import schedframe.resources.devices.Device; import schedframe.resources.devices.PhysicalResource; import schedframe.scheduling.manager.tasks.JobRegistry; import simulator.ConfigurationOptions; import example.energy.BaseEnergyEstimationPlugin; import test.fips.EnvironmentConditions; public class TangCoolingDeviceEnergyEstimationPlugin extends BaseEnergyEstimationPlugin { public double estimateAirflow(ResourceEvent event, JobRegistry jobRegistry, PhysicalResource resource) { double airflow = 0; return airflow; } public double estimatePowerConsumption(ResourceEvent event, JobRegistry jobRegistry, PhysicalResource resource) { double powerConsumption = 0; Device coolingDevice = (Device) resource; ComputingResource room = (ComputingResource) coolingDevice.getComputingResource(); double Pload_dc = calculatePit(room); double Pothers = calculatePothers(Pload_dc); double airTemp = EnvironmentConditions.ROOM_TEMPERATURE; double CoP = 0.0068 * Math.pow(airTemp, 2) + 0.0008 * airTemp + 0.458; powerConsumption = (Pload_dc + Pothers)/CoP; return powerConsumption; } private double calculatePit(ComputingResource room){ double Pload_dc = 0; for(ComputingResource cr: room.getChildren()){ Rack rack = (Rack)cr; Pload_dc = Pload_dc + rack.getPowerInterface().getRecentPowerUsage().getValue(); } return Pload_dc; } private double calculatePothers(double Pload_dc){ double Pothers = 0; double a;//experiment try{ a = ConfigurationOptions.coolingData.getAlpha(); } catch (Exception e){ a = 0.02; } Pothers = a * Pload_dc; return Pothers; } }