source: xssim/src/example/energy/BaseEnergyEstimationPlugin.java @ 104

Revision 104, 1.3 KB checked in by wojtekp, 13 years ago (diff)
  • Property svn:mime-type set to text/plain
Line 
1package example.energy;
2
3import test.rewolucja.energy.EnergyEvent;
4import test.rewolucja.energy.plugin.EnergyEstimationPluginInterface;
5import test.rewolucja.resources.physical.base.ComputingResource;
6import test.rewolucja.scheduling.JobRegistryInterface;
7import test.rewolucja.scheduling.PluginConfiguration;
8
9public abstract class BaseEnergyEstimationPlugin implements EnergyEstimationPluginInterface {
10
11        @Override
12        public PluginConfiguration getConfiguration() {
13                // TODO Auto-generated method stub
14                return null;
15        }
16       
17        @Override
18        public double estimatePowerConsumption(EnergyEvent event, JobRegistryInterface jobRegistry, ComputingResource resource) {
19                double power = 0;
20                if(resource.getChildren() == null)
21                        return resource.getPowerInterface().getPowerConsumption(resource.getPowerInterface().getPowerState());
22                for(ComputingResource child:resource.getChildren()){
23                        power = power + child.getPowerInterface().getRecentPowerUsage().getValue();
24                }
25                return power;
26        }
27
28        @Override
29        public double estimateEnergyDissipation(EnergyEvent event, JobRegistryInterface jobRegistry, ComputingResource resourceManager) {
30                throw new RuntimeException("Not implemented.");
31        }
32
33        @Override
34        public double estimateTemperature(EnergyEvent event, JobRegistryInterface jobRegistry, ComputingResource resourceManager) {
35                throw new RuntimeException("Not implemented.");
36        }
37
38}
Note: See TracBrowser for help on using the repository browser.