Ignore:
Timestamp:
07/30/14 12:25:00 (11 years ago)
Author:
wojtekp
Message:
 
Location:
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerProfile.java

    r1207 r1423  
    6464        public List<PowerState> getSupportedPowerStates() { 
    6565                if(supportedPowerStates == null) 
    66                         return new ArrayList<PowerState>(); 
     66                        return new ArrayList<PowerState>(0); 
    6767                return supportedPowerStates; 
    6868        } 
     
    7070        public Map<String, PState> getSupportedPStates() { 
    7171                if(supportedPStates == null) 
    72                         return new HashMap<String, PState>(); 
     72                        return new HashMap<String, PState>(0); 
    7373                return supportedPStates; 
    7474        } 
     
    117117                boolean supportsOFF = false; 
    118118                if(supportedPowerStates == null){ 
    119                         supportedPowerStates = new ArrayList<PowerState>(); 
     119                        supportedPowerStates = new ArrayList<PowerState>(4); 
    120120                } 
    121121                for(PowerState ps: supportedPowerStates){ 
     
    128128                 
    129129                if(!supportsON){ 
    130                         supportedPowerStates.add(new PowerState(StandardPowerStateName.ON, -1, new ArrayList<Transition>())); 
     130                        supportedPowerStates.add(new PowerState(StandardPowerStateName.ON, -1, null)); 
     131                        supportedPowerStates.add(new PowerState(StandardPowerStateName.BOOT, -1, null)); 
    131132                } 
    132133                if(!supportsOFF){ 
    133                         supportedPowerStates.add(new PowerState(StandardPowerStateName.OFF, -1, new ArrayList<Transition>())); 
     134                        supportedPowerStates.add(new PowerState(StandardPowerStateName.OFF, -1, null)); 
     135                        supportedPowerStates.add(new PowerState(StandardPowerStateName.POWEROFF, -1, null)); 
    134136                } 
    135137        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerState.java

    r477 r1423  
    11package schedframe.resources.computing.profiles.energy.power; 
    22 
     3import java.util.ArrayList; 
    34import java.util.List; 
    45 
     
    2425        } 
    2526        public List<Transition> getTransitions() { 
     27                if(transitions == null) 
     28                        return new ArrayList<Transition>(0); 
    2629                return transitions; 
    2730        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java

    r1415 r1423  
    11package schedframe.resources.computing.profiles.energy.power.ui; 
    22 
    3 import java.util.ArrayList; 
    43import java.util.List; 
    54 
     
    6564 
    6665        public List<PowerState> getSupportedPowerStates(){ 
    67                 List<PowerState> powerStates = new ArrayList<PowerState>(); 
    68                 for(PowerState powerState: powerProfile.getSupportedPowerStates()){ 
    69                         powerStates.add(powerState); 
    70                 } 
    71                 return powerStates; 
     66                return powerProfile.getSupportedPowerStates(); 
    7267        } 
    7368 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/NodePowerInterface.java

    r1415 r1423  
    44 
    55import java.util.List; 
     6 
    67 
    78import schedframe.resources.ResourceStatus; 
     
    3738                        } 
    3839 
    39                         if(state == StandardPowerStateName.OFF){ 
     40                        if(state == StandardPowerStateName.OFF || state == StandardPowerStateName.POWEROFF){ 
    4041                                node.setStatus(ResourceStatus.UNAVAILABLE); 
    4142                        } 
    42                         else if(state == StandardPowerStateName.ON){ 
     43                        else if(state == StandardPowerStateName.ON || state == StandardPowerStateName.BOOT){ 
    4344                                node.setStatus(ResourceStatus.FREE); 
    4445                        } 
     
    5556                /*double timePenalty = getTransitionTime(currentPowerState, StandardPowerStateName.ON); 
    5657                setPowerState(StandardPowerStateName.BOOT); 
    57                 DataCenterWorkloadSimulator.getEventManager().sendToResource(resource.getFullName(), timePenalty, new ResourceEvent(ResourceEventType.UPDATE_POWER_STATE, StandardPowerStateName.ON, resource.getFullName()));*/ 
     58                DataCenterWorkloadSimulator.getEventManager().sendToResource(resource.getFullName(), timePenalty, new ResourceEvent(ResourceEventType.UPDATE_POWER_STATE, StandardPowerStateName.ON, resource.getFullName())); 
     59                 */              
    5860                setPowerState(StandardPowerStateName.ON); 
    5961        } 
     
    6870        private double getTransitionTime(PowerStateName from, PowerStateName to){ 
    6971                List<PowerState> availablePowerStates = getSupportedPowerStates(); 
    70                 double timePenalty = 0; 
     72                double time = 0; 
    7173                for(PowerState ps : availablePowerStates){ 
    7274                        if(ps.getName().getLabel().equals(from.getLabel())){ 
     
    7476                                for(Transition t: transitions){ 
    7577                                        if(t.getTo().getLabel().equals(to)){ 
    76                                                 timePenalty = t.getTime(); 
     78                                                time = t.getTime(); 
    7779                                        } 
    7880                                } 
    7981                        } 
    8082                } 
    81                 return timePenalty; 
     83                return time; 
    8284        } 
    8385 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/PowerInterface.java

    r1380 r1423  
    2424        //public double getCurrentPowerConsumption(); 
    2525         
    26         List<PowerUsage> getPowerUsageHistory(); 
     26        public List<PowerUsage> getPowerUsageHistory(); 
    2727         
    2828        public Parameters getParameters(); 
Note: See TracChangeset for help on using the changeset viewer.