Line | |
---|
1 | package experiments.simpat2014.models.article; |
---|
2 | |
---|
3 | import schedframe.resources.computing.profiles.energy.ResourceEvent; |
---|
4 | import schedframe.resources.devices.Device; |
---|
5 | import schedframe.resources.devices.PhysicalResource; |
---|
6 | import schedframe.scheduling.manager.tasks.JobRegistry; |
---|
7 | import example.energy.BaseEnergyEstimationPlugin; |
---|
8 | |
---|
9 | |
---|
10 | public class PowerLeakageEnergyEstimationPlugin extends BaseEnergyEstimationPlugin{ |
---|
11 | |
---|
12 | public double estimatePowerConsumption(ResourceEvent event, JobRegistry jobRegistry, |
---|
13 | PhysicalResource resource) { |
---|
14 | |
---|
15 | double powerLekage = 0; |
---|
16 | Device pl = (Device) resource; |
---|
17 | double tempDiff = pl.getComputingResource().getThermalInterface().getRecentTemperature().getValue() - 65; |
---|
18 | if(tempDiff < 0) |
---|
19 | return 0; |
---|
20 | |
---|
21 | powerLekage = 0.02 * tempDiff * pl.getComputingResource().getPowerInterface().getRecentPowerUsage().getValue(); |
---|
22 | //powerConsumption = factor * pl.getComputingResource().getPowerInterface().getRecentPowerUsage().getValue(); |
---|
23 | /*Device pl = (Device) resource; |
---|
24 | if(pl.getComputingResource().getThermalInterface().getRecentTemperature().getValue() > 90){ |
---|
25 | powerConsumption = powerConsumption + 15; |
---|
26 | }*/ |
---|
27 | return powerLekage; |
---|
28 | } |
---|
29 | |
---|
30 | |
---|
31 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.