Changeset 150 for xssim/trunk/src


Ignore:
Timestamp:
03/16/12 09:08:33 (13 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • xssim/trunk/src/example/energy/DataCenterEnergyEstimationPlugin.java

    r104 r150  
    55import schedframe.resources.profile.PowerUsage; 
    66import test.rewolucja.energy.EnergyEvent; 
    7 import test.rewolucja.energy.plugin.EnergyEstimationPluginInterface; 
    87import test.rewolucja.resources.physical.base.ComputingResource; 
    9 import test.rewolucja.resources.physical.implementation.CPU; 
    108import test.rewolucja.resources.physical.implementation.ComputingNode; 
    11 import test.rewolucja.resources.physical.implementation.DataCenter; 
    129import test.rewolucja.scheduling.JobRegistryInterface; 
    13 import test.rewolucja.scheduling.PluginConfiguration; 
    1410 
    15 public class DataCenterEnergyEstimationPlugin implements EnergyEstimationPluginInterface { 
     11public class DataCenterEnergyEstimationPlugin extends BaseEnergyEstimationPlugin{ 
    1612 
    1713        @Override 
     
    2420                        power += (powerUsage == null ? 0 : powerUsage.getValue()); 
    2521                } 
    26                 //power += 100; 
    27                 if(power < 140){ 
    28                         for(ComputingResource child:resource.getChildren()){ 
    29                                 ComputingNode node = (ComputingNode)child; 
    30                                 for(CPU cpu:node.getProcessors()){ 
    31                                         //cpu.getPowerProfile().setFrequency(2000); 
    32                                 } 
    33                         } 
    34                 } 
     22                 
    3523                //System.out.println( new DateTime() + "ENERGY CONSUMPT BY: " + resMan.getResourceName() +" IS: " + power); 
    3624                return power; 
    3725        } 
    3826 
    39         @Override 
    4027        public String getName() { 
    41                 // TODO Auto-generated method stub 
    42                 return null; 
     28                return getClass().getName(); 
    4329        } 
    4430 
    45         @Override 
    4631        public void init(Properties properties) { 
    4732                // TODO Auto-generated method stub 
     
    4934        } 
    5035 
    51         @Override 
    52         public PluginConfiguration getConfiguration() { 
    53                 // TODO Auto-generated method stub 
    54                 return null; 
    55         } 
    56  
    57         @Override 
    58         public double estimateEnergyDissipation(EnergyEvent event, JobRegistryInterface jobRegistry, ComputingResource resourceManager) { 
    59                 // TODO Auto-generated method stub 
    60                 return 0; 
    61         } 
    62  
    63         @Override 
    64         public double estimateTemperature(EnergyEvent event, JobRegistryInterface jobRegistry, ComputingResource resourceManager) { 
    65                 // TODO Auto-generated method stub 
    66                 return 0; 
    67         } 
    68  
    6936} 
Note: See TracChangeset for help on using the changeset viewer.