Changeset 774 for DCWoRMS/trunk


Ignore:
Timestamp:
01/10/13 10:54:36 (12 years ago)
Author:
wojtekp
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/trunk/src/example/energy/ComputingNodeWithFanEnergyEstimationPlugin.java

    r751 r774  
    11package example.energy; 
    22 
     3import schedframe.events.scheduling.EventReason; 
    34import schedframe.resources.computing.ComputingNode; 
    45import schedframe.resources.computing.ComputingResource; 
    56import schedframe.resources.computing.Processor; 
    67import schedframe.resources.computing.profiles.energy.EnergyEvent; 
     8import schedframe.resources.computing.profiles.energy.airthroughput.StandardAirThroughputStateName; 
    79import schedframe.scheduling.manager.tasks.JobRegistry; 
    810 
     
    2224                try { 
    2325                        powerConsumption = powerConsumption + node.getPowerInterface().getPowerConsumption(node.getPowerInterface().getPowerState()); 
    24                         powerConsumption = powerConsumption + node.getAirThroughputInterface().getPowerConsumption(node.getAirThroughputInterface().getAirThroughputState()); 
     26                        if(event.getReason() == EventReason.SIM_INIT) 
     27                                powerConsumption = powerConsumption + node.getAirThroughputInterface().getPowerConsumption(StandardAirThroughputStateName.FAN_OFF); 
     28                        else 
     29                                powerConsumption = powerConsumption + node.getAirThroughputInterface().getPowerConsumption(node.getAirThroughputInterface().getAirThroughputState()); 
    2530                } catch (NoSuchFieldException e) { 
    2631                } 
     
    3237                double airThroughput = 0; 
    3338                try { 
    34                         airThroughput = resource.getAirThroughputInterface().getAirFlow(resource.getAirThroughputInterface().getAirThroughputState()); 
     39                        if(event.getReason() == EventReason.SIM_INIT) 
     40                                airThroughput = resource.getAirThroughputInterface().getAirFlow(StandardAirThroughputStateName.FAN_OFF); 
     41                        else 
     42                                airThroughput = resource.getAirThroughputInterface().getAirFlow(resource.getAirThroughputInterface().getAirThroughputState()); 
    3543                } catch (NoSuchFieldException e) { 
    3644                        // TODO Auto-generated catch block 
Note: See TracChangeset for help on using the changeset viewer.