Ignore:
Timestamp:
06/26/14 14:18:01 (11 years ago)
Author:
wojtekp
Message:
 
Location:
DCWoRMS/branches/coolemall/src/schedframe
Files:
2 added
2 deleted
27 edited
21 moved

Legend:

Unmodified
Added
Removed
  • DCWoRMS/branches/coolemall/src/schedframe/SimulatedEnvironment.java

    r1207 r1396  
    1111 
    1212import schedframe.exceptions.ResourceException; 
    13 import schedframe.resources.ResourceHistoryChanges; 
     13import schedframe.resources.ResourceHistoryItem; 
    1414import schedframe.resources.computing.ComputingResource; 
    1515import schedframe.scheduling.Scheduler; 
     
    2121        protected List<Initializable> toInit; 
    2222        protected Set<String> compResLayers; 
    23         protected static List<ResourceHistoryChanges> compResHistory = new ArrayList<ResourceHistoryChanges>(); 
     23        protected static List<ResourceHistoryItem> compResHistory = new ArrayList<ResourceHistoryItem>(); 
    2424         
    2525        public SimulatedEnvironment(Scheduler logicalStructure, List<ComputingResource> compResources){ 
     
    156156 
    157157        public static void traceResource(long timestamp, String resourceName, String operation, String paramter){ 
    158                 ResourceHistoryChanges rhc = new ResourceHistoryChanges(timestamp, resourceName, operation, paramter); 
     158                ResourceHistoryItem rhc = new ResourceHistoryItem(timestamp, resourceName, operation, paramter); 
    159159                compResHistory.add(rhc); 
    160160        } 
    161161 
    162         public static List<ResourceHistoryChanges> getCompResHistory() { 
     162        public static List<ResourceHistoryItem> getCompResHistory() { 
    163163                return compResHistory; 
    164164        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/CustomResourceType.java

    r477 r1396  
    22 
    33 
    4 public class UserResourceType implements ResourceType { 
     4public class CustomResourceType implements ResourceType { 
    55 
    66        protected String name; 
    77 
    8         public UserResourceType(String name) { 
     8        public CustomResourceType(String name) { 
    99                this.name = name; 
    1010        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceHistoryItem.java

    r1207 r1396  
    22 
    33 
    4 public class ResourceHistoryChanges { 
     4public class ResourceHistoryItem { 
    55         
    66        private long timestamp;  
    77        private String resourceName; 
    8         private String operation; 
     8        private String action; 
    99        private String paramter; 
    1010         
    11         public ResourceHistoryChanges(long timestamp, String resourceName, String operation, String paramter) { 
     11        public ResourceHistoryItem(long timestamp, String resourceName, String action, String paramter) { 
    1212                super(); 
    1313                this.timestamp = timestamp; 
    1414                this.resourceName = resourceName; 
    15                 this.operation = operation; 
     15                this.action = action; 
    1616                this.paramter = paramter; 
    1717        } 
     
    2525        } 
    2626         
    27         public String getOperation() { 
    28                 return operation; 
     27        public String getAction() { 
     28                return action; 
    2929        } 
    3030         
  • DCWoRMS/branches/coolemall/src/schedframe/resources/ResourceTypeFactory.java

    r1207 r1396  
    6060                        return StandardResourceType.LS; 
    6161                 
    62                 return new UserResourceType(typeName); 
     62                return new CustomResourceType(typeName); 
    6363        } 
    6464} 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/ComputingResource.java

    r1392 r1396  
    5757                initCharacteristics(resDesc); 
    5858                accept(new LoadExtension(resDesc.getLoadProfile(), this)); 
    59                 accept(new EnergyExtension.Builder().resource(this).powerProfile(resDesc.getPowerProfile()).airFlowProfile(resDesc.getAirThroughputProfile()).thermalProfile(resDesc.getThermalProfile()).build());      
     59                accept(new EnergyExtension.Builder().resource(this).powerProfile(resDesc.getPowerProfile()).airflowProfile(resDesc.getAirflowProfile()).thermalProfile(resDesc.getThermalProfile()).build());    
    6060        } 
    6161 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/EnergyExtension.java

    r1389 r1396  
    1010import schedframe.resources.computing.extensions.ExtensionException; 
    1111import schedframe.resources.computing.extensions.ExtensionType; 
    12 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputInterfaceFactory; 
    13 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile; 
    14 import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface; 
     12import schedframe.resources.computing.profiles.energy.airthroughput.AirflowInterfaceFactory; 
     13import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile; 
     14import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirflowInterface; 
    1515import schedframe.resources.computing.profiles.energy.power.PowerInterfaceFactory; 
    1616import schedframe.resources.computing.profiles.energy.power.PowerProfile; 
     
    3030        protected PowerProfile powerProfile; 
    3131         
    32         protected AirThroughputInterface airFlowInterface; 
    33         protected AirThroughputProfile airFlowProfile; 
     32        protected AirflowInterface airflowInterface; 
     33        protected AirflowProfile airflowProfile; 
    3434         
    3535        protected ThermalInterface thermalInterface; 
     
    7474                protected PowerProfile powerProfile; 
    7575                 
    76                 protected AirThroughputInterface airFlowInterface; 
    77                 protected AirThroughputProfile airFlowProfile; 
     76                protected AirflowInterface airflowInterface; 
     77                protected AirflowProfile airflowProfile; 
    7878                 
    7979                protected ThermalInterface thermalInterface; 
     
    8484                public Builder powerProfile(PowerProfile pp){this.powerProfile = pp; this.powerInterface = PowerInterfaceFactory.createPowerInterface(resource, powerProfile); return this; } 
    8585 
    86         public Builder airFlowProfile(AirThroughputProfile atp){this.airFlowProfile = atp; this.airFlowInterface = AirThroughputInterfaceFactory.createAirThroughputInterface(resource, airFlowProfile); return this; } 
     86        public Builder airflowProfile(AirflowProfile atp){this.airflowProfile = atp; this.airflowInterface = AirflowInterfaceFactory.createAirflowInterface(resource, airflowProfile); return this; } 
    8787 
    8888        public Builder thermalProfile(ThermalProfile tp){this.thermalProfile = tp; this.thermalInterface = ThermalInterfaceFactory.createThermalInterface(resource, thermalProfile); return this; } 
     
    9898                this.powerProfile = builder.powerProfile; 
    9999                 
    100                 this.airFlowInterface = builder.airFlowInterface ; 
    101                 this.airFlowProfile = builder.airFlowProfile; 
     100                this.airflowInterface = builder.airflowInterface ; 
     101                this.airflowProfile = builder.airflowProfile; 
    102102                 
    103103                this.thermalInterface = builder.thermalInterface; 
     
    163163                                 
    164164                        case AIRFLOW_STATE_CHANGED: 
    165                                 double airFlow = powerProfile.getEnergyEstimationPlugin().estimateAirThroughput(enEvent, new JobRegistryImpl(resource.getFullName()), resource); 
    166                                 airFlowProfile.addToAirFlowHistory(airFlow); 
     165                                double airflow = powerProfile.getEnergyEstimationPlugin().estimateAirflow(enEvent, new JobRegistryImpl(resource.getFullName()), resource); 
     166                                airflowProfile.addToAirFlowHistory(airflow); 
    167167                                break; 
    168168                                 
     
    204204        } 
    205205 
    206         public AirThroughputInterface getAirThroughputInterface() { 
    207                 return airFlowInterface; 
    208         } 
    209  
    210         public AirThroughputProfile getAirFlowProfile() { 
    211                 return airFlowProfile; 
     206        public AirflowInterface getAirflowInterface() { 
     207                return airflowInterface; 
     208        } 
     209 
     210        public AirflowProfile getAirFlowProfile() { 
     211                return airflowProfile; 
    212212        } 
    213213         
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirFlowValue.java

    r495 r1396  
    33import schedframe.resources.computing.profiles.energy.MeasurementHistory; 
    44 
    5 public class AirFlowValue extends MeasurementHistory{ 
     5public class AirflowValue extends MeasurementHistory{ 
    66 
    7         public AirFlowValue(long timestamp, double value){ 
     7        public AirflowValue(long timestamp, double value){ 
    88                super(timestamp, value); 
    99        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowInterfaceFactory.java

    r1318 r1396  
    33import schedframe.resources.StandardResourceType; 
    44import schedframe.resources.computing.ComputingResource; 
    5 import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface; 
    6 import schedframe.resources.computing.profiles.energy.airthroughput.ui.ComputingResourceAirThroughputInterface; 
     5import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirflowInterface; 
     6import schedframe.resources.computing.profiles.energy.airthroughput.ui.ComputingResourceAirflowInterface; 
    77import schedframe.resources.devices.PhysicalResource; 
    8 import schedframe.resources.devices.DeviceAirThroughputInterface; 
    9 import schedframe.resources.devices.coolemall.FanAirThroughputInterface; 
     8import schedframe.resources.devices.DeviceAirflowInterface; 
     9import schedframe.resources.devices.coolemall.FanAirflowInterface; 
    1010 
    11 public class AirThroughputInterfaceFactory { 
     11public class AirflowInterfaceFactory { 
    1212         
    13         public static AirThroughputInterface createAirThroughputInterface(PhysicalResource resource, AirThroughputProfile atp){ 
     13        public static AirflowInterface createAirflowInterface(PhysicalResource resource, AirflowProfile atp){ 
    1414                if(atp == null) 
    1515                        return null; 
    16                 AirThroughputInterface airThroughputInterface = null; 
     16                AirflowInterface airflowInterface = null; 
    1717                if(resource.getType().getName().equals(StandardResourceType.CRAH.getName())) 
    18                         airThroughputInterface = new DeviceAirThroughputInterface(resource, atp); 
     18                        airflowInterface = new DeviceAirflowInterface(resource, atp); 
    1919                else if(resource.getType().getName().equals(StandardResourceType.Fan.getName())) 
    20                         airThroughputInterface = new FanAirThroughputInterface(resource, atp); 
     20                        airflowInterface = new FanAirflowInterface(resource, atp); 
    2121                else if(resource.getType().getName().equals(StandardResourceType.Inlet.getName())) 
    22                         airThroughputInterface = new FanAirThroughputInterface(resource, atp); 
     22                        airflowInterface = new FanAirflowInterface(resource, atp); 
    2323                else if(resource.getType().getName().equals(StandardResourceType.Outlet.getName())) 
    24                         airThroughputInterface = new FanAirThroughputInterface(resource, atp); 
     24                        airflowInterface = new FanAirflowInterface(resource, atp); 
    2525                else if(resource.getType().getName().equals(StandardResourceType.CoolingDevice.getName())) 
    26                         airThroughputInterface = new DeviceAirThroughputInterface(resource, atp); 
     26                        airflowInterface = new DeviceAirflowInterface(resource, atp); 
    2727                else 
    28                         airThroughputInterface = new ComputingResourceAirThroughputInterface((ComputingResource)resource, atp); 
    29                 return airThroughputInterface; 
     28                        airflowInterface = new ComputingResourceAirflowInterface((ComputingResource)resource, atp); 
     29                return airflowInterface; 
    3030        } 
    3131} 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowProfile.java

    r1207 r1396  
    77 
    88import schedframe.Parameters; 
    9 import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirThroughputEstimationPlugin; 
     9import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirflowEstimationPlugin; 
    1010 
    11 public class AirThroughputProfile { 
     11public class AirflowProfile { 
    1212         
    13         protected List<AirFlowValue> airFlowHistory; 
     13        protected List<AirflowValue> airflowHistory; 
    1414         
    15         protected AirThroughputEstimationPlugin airThroughputEstimationPlugin; 
    16         protected List <AirThroughputState> airThroughputStates; 
     15        protected AirflowEstimationPlugin airflowEstimationPlugin; 
     16        protected List <AirflowState> airflowStates; 
    1717        protected Parameters parameters; 
    1818 
    19         public AirThroughputProfile(AirThroughputEstimationPlugin airThroughputEstimationPlugin, List<AirThroughputState> airThroughputStates) { 
     19        public AirflowProfile(AirflowEstimationPlugin airflowEstimationPlugin, List<AirflowState> airflowStates) { 
    2020                super(); 
    21                 this.airThroughputEstimationPlugin = airThroughputEstimationPlugin; 
    22                 this.airThroughputStates = airThroughputStates; 
    23                 this.airFlowHistory = new ArrayList<AirFlowValue>(); 
     21                this.airflowEstimationPlugin = airflowEstimationPlugin; 
     22                this.airflowStates = airflowStates; 
     23                this.airflowHistory = new ArrayList<AirflowValue>(); 
    2424        } 
    2525 
    26         public List<AirThroughputState> getAirThroughputStates() { 
    27                 return airThroughputStates; 
     26        public List<AirflowState> getAirflowStates() { 
     27                return airflowStates; 
    2828        } 
    2929         
    30         public void addToAirFlowHistory(double airFlow) { 
     30        public void addToAirFlowHistory(double airflow) { 
    3131 
    32                 if (airFlowHistory.size() == 0) { 
    33                         AirFlowValue usage = new AirFlowValue(DateTimeUtils.currentTimeMillis(), airFlow); 
    34                         airFlowHistory.add(usage); 
     32                if (airflowHistory.size() == 0) { 
     33                        AirflowValue usage = new AirflowValue(DateTimeUtils.currentTimeMillis(), airflow); 
     34                        airflowHistory.add(usage); 
    3535                        return; 
    3636                } 
    3737 
    38                 int lastIdx = airFlowHistory.size() - 1; 
    39                 double lastAirFlow = airFlowHistory.get(lastIdx).getValue(); 
    40                 if (lastAirFlow != airFlow) { 
    41                         AirFlowValue usage = airFlowHistory.get(lastIdx); 
     38                int lastIdx = airflowHistory.size() - 1; 
     39                double lastAirflow = airflowHistory.get(lastIdx).getValue(); 
     40                if (lastAirflow != airflow) { 
     41                        AirflowValue usage = airflowHistory.get(lastIdx); 
    4242                        long currentTime = DateTimeUtils.currentTimeMillis(); 
    4343                        if (usage.getTimestamp() == currentTime) { 
    44                                 usage.setValue(airFlow); 
    45                                 if(lastIdx > 0 && airFlowHistory.get(lastIdx - 1).getValue() == airFlow) 
    46                                         airFlowHistory.remove(usage); 
     44                                usage.setValue(airflow); 
     45                                if(lastIdx > 0 && airflowHistory.get(lastIdx - 1).getValue() == airflow) 
     46                                        airflowHistory.remove(usage); 
    4747                        } else { 
    48                                 usage = new AirFlowValue(DateTimeUtils.currentTimeMillis(), airFlow); 
    49                                 airFlowHistory.add(usage); 
     48                                usage = new AirflowValue(DateTimeUtils.currentTimeMillis(), airflow); 
     49                                airflowHistory.add(usage); 
    5050                        } 
    5151                } 
    5252        } 
    5353 
    54         public List<AirFlowValue> getAirThroughputHistory() { 
    55                 return airFlowHistory; 
     54        public List<AirflowValue> getAirflowHistory() { 
     55                return airflowHistory; 
    5656        } 
    5757         
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowState.java

    r477 r1396  
    33import schedframe.Parameters; 
    44 
    5 public class AirThroughputState { 
     5public class AirflowState { 
    66 
    7         protected String name; 
     7        protected AirflowStateName name; 
    88        protected double value; 
    99        protected double powerUsage; 
    1010         
    11         public AirThroughputState(String name, double value, double powerUsage) { 
     11        public AirflowState(AirflowStateName name, double value, double powerUsage) { 
    1212                super(); 
    1313                this.name = name; 
     
    1616        } 
    1717         
    18         public String getName() { 
     18        public AirflowStateName getName() { 
    1919                return name; 
    2020        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/AirflowStateName.java

    r753 r1396  
    11package schedframe.resources.computing.profiles.energy.airthroughput; 
    22 
    3 public interface AirThroughputStateName { 
     3public interface AirflowStateName { 
    44 
    5         public String getName(); 
     5        public String getLabel(); 
    66 
    77} 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/CustomAirflowStateName.java

    r753 r1396  
    22 
    33 
    4 public class UserAirThroughputStateName implements AirThroughputStateName{ 
     4public class CustomAirflowStateName implements AirflowStateName{ 
    55 
    66        protected String name; 
    77 
    8         public UserAirThroughputStateName(String name) { 
     8        public CustomAirflowStateName(String name) { 
    99                this.name = name; 
    1010        } 
    1111 
    12         public String getName() { 
     12        public String getLabel() { 
    1313                return name; 
    1414        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/StandardAirflowStateName.java

    r1207 r1396  
    11package schedframe.resources.computing.profiles.energy.airthroughput; 
    22 
    3 public enum  StandardAirThroughputStateName implements AirThroughputStateName{ 
     3public enum  StandardAirflowStateName implements AirflowStateName{ 
    44 
    55        ON, 
    66        OFF; 
    77 
    8         public String getName() { 
     8        public String getLabel() { 
    99                return toString(); 
    1010        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/AirflowEstimationPlugin.java

    r748 r1396  
    66import schedframe.scheduling.manager.tasks.JobRegistry; 
    77 
    8 public interface AirThroughputEstimationPlugin extends Plugin { 
     8public interface AirflowEstimationPlugin extends Plugin { 
    99         
    10         public double estimateAirThroughput(Event event, JobRegistry jobRegistry, ComputingResource resource); 
     10        public double estimateAirflow(Event event, JobRegistry jobRegistry, ComputingResource resource); 
    1111} 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/plugin/DefaultAirflowEstimationPlugin.java

    r770 r1396  
    77import schedframe.scheduling.manager.tasks.JobRegistry; 
    88 
    9 public class DefaultAirThroughputEstimationPlugin implements AirThroughputEstimationPlugin { 
     9public class DefaultAirflowEstimationPlugin implements AirflowEstimationPlugin { 
    1010 
    1111        @Override 
     
    2828 
    2929        @Override 
    30         public double estimateAirThroughput(Event event, JobRegistry jobRegistry, ComputingResource resource) { 
     30        public double estimateAirflow(Event event, JobRegistry jobRegistry, ComputingResource resource) { 
    3131                throw new RuntimeException("This interface is depracated. For air throughput estimation please use the estimateAirThroughput method form EnergyEstimationPlugin interface."); 
    3232        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/AirflowInterface.java

    r1380 r1396  
    44 
    55import schedframe.Parameters; 
    6 import schedframe.resources.computing.profiles.energy.airthroughput.AirFlowValue; 
    7 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState; 
    8 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputStateName; 
     6import schedframe.resources.computing.profiles.energy.airthroughput.AirflowValue; 
     7import schedframe.resources.computing.profiles.energy.airthroughput.AirflowState; 
     8import schedframe.resources.computing.profiles.energy.airthroughput.AirflowStateName; 
    99 
    10 public interface AirThroughputInterface { 
     10public interface AirflowInterface { 
    1111         
    12         public AirThroughputStateName getAirThroughputState(); 
     12        public AirflowStateName getAirflowState(); 
    1313         
    14         public boolean setAirThroughputState(AirThroughputStateName airThroughputState); 
     14        public boolean setAirflowState(AirflowStateName airflowState); 
    1515         
    16         public boolean supportAirThroughputState(AirThroughputStateName powerState); 
     16        public boolean supportAirflowState(AirflowStateName powerState); 
    1717         
    18         public List<AirThroughputState> getSupportedAirThroughputStates(); 
     18        public List<AirflowState> getSupportedAirflowStates(); 
    1919         
    20         public double getAirFlow(AirThroughputStateName state) throws NoSuchFieldException; 
     20        public double getAirflow(AirflowStateName state) throws NoSuchFieldException; 
    2121         
    22         public double getPowerConsumption(AirThroughputStateName state) throws NoSuchFieldException; 
     22        public double getPowerConsumption(AirflowStateName state) throws NoSuchFieldException; 
    2323         
    24         public AirFlowValue getRecentAirFlow(); 
     24        public AirflowValue getRecentAirflow(); 
    2525         
    26         List<AirFlowValue> getAirFlowHistory(); 
     26        List<AirflowValue> getAirflowHistory(); 
    2727         
    2828        public Parameters getParameters(); 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/airthroughput/ui/ComputingResourceAirflowInterface.java

    r1380 r1396  
    1010import schedframe.resources.computing.profiles.energy.EnergyEvent; 
    1111import schedframe.resources.computing.profiles.energy.EnergyEventType; 
    12 import schedframe.resources.computing.profiles.energy.airthroughput.AirFlowValue; 
    13 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile; 
    14 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState; 
    15 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputStateName; 
    16 import schedframe.resources.computing.profiles.energy.airthroughput.StandardAirThroughputStateName; 
     12import schedframe.resources.computing.profiles.energy.airthroughput.AirflowValue; 
     13import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile; 
     14import schedframe.resources.computing.profiles.energy.airthroughput.AirflowState; 
     15import schedframe.resources.computing.profiles.energy.airthroughput.AirflowStateName; 
     16import schedframe.resources.computing.profiles.energy.airthroughput.StandardAirflowStateName; 
    1717 
    18 public class ComputingResourceAirThroughputInterface implements AirThroughputInterface{ 
     18public class ComputingResourceAirflowInterface implements AirflowInterface{ 
    1919 
    20         protected AirThroughputStateName currentAirThroughputState; 
    21         protected AirThroughputProfile airThroughputProfile; 
     20        protected AirflowStateName currentAirflowState; 
     21        protected AirflowProfile airflowProfile; 
    2222        protected ComputingResource resource; 
    2323         
    24         public ComputingResourceAirThroughputInterface(ComputingResource resource, AirThroughputProfile airThroughputProfile){ 
     24        public ComputingResourceAirflowInterface(ComputingResource resource, AirflowProfile airflowProfile){ 
    2525                this.resource = resource; 
    26                 this.airThroughputProfile = airThroughputProfile; 
    27                 this.currentAirThroughputState = StandardAirThroughputStateName.ON; 
     26                this.airflowProfile = airflowProfile; 
     27                this.currentAirflowState = StandardAirflowStateName.ON; 
    2828        } 
    2929         
    30         public AirThroughputStateName getAirThroughputState() { 
    31                 return currentAirThroughputState; 
     30        public AirflowStateName getAirflowState() { 
     31                return currentAirflowState; 
    3232        } 
    3333 
    34         public boolean setAirThroughputState(AirThroughputStateName state) { 
    35                 if(supportAirThroughputState(state)){ 
    36                         currentAirThroughputState = state; 
     34        public boolean setAirflowState(AirflowStateName state) { 
     35                if(supportAirflowState(state)){ 
     36                        currentAirflowState = state; 
    3737                         
    3838                        //TO DO - notifications should be called for all resources starting form the lowest layer 
     
    4444        } 
    4545 
    46         public boolean supportAirThroughputState(AirThroughputStateName state) { 
    47                 for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){ 
    48                         if(airFlowState.getName().equals(state.getName())){ 
     46        public boolean supportAirflowState(AirflowStateName state) { 
     47                for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 
     48                        if(airflowState.getName().equals(state.getLabel())){ 
    4949                                return true; 
    5050                        } 
     
    5353        } 
    5454 
    55         public List<AirThroughputState> getSupportedAirThroughputStates() { 
    56                 List<AirThroughputState> airThroughputStates = new ArrayList<AirThroughputState>(); 
    57                 for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){ 
    58                         airThroughputStates.add(airFlowState); 
     55        public List<AirflowState> getSupportedAirflowStates() { 
     56                List<AirflowState> airflowStates = new ArrayList<AirflowState>(); 
     57                for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 
     58                        airflowStates.add(airflowState); 
    5959                } 
    60                 return airThroughputStates; 
     60                return airflowStates; 
    6161        } 
    6262 
    63         public double getAirFlow(AirThroughputStateName state) throws NoSuchFieldException { 
    64                 double airThroughput = 0; 
    65                 if(supportAirThroughputState(state)){ 
    66                         for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){ 
    67                                 if(airFlowState.getName().equals(state.getName())){ 
    68                                         airThroughput = airFlowState.getValue(); 
     63        public double getAirflow(AirflowStateName state) throws NoSuchFieldException { 
     64                double airflow = 0; 
     65                if(supportAirflowState(state)){ 
     66                        for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 
     67                                if(airflowState.getName().equals(state.getLabel())){ 
     68                                        airflow = airflowState.getValue(); 
    6969                                        break; 
    7070                                } 
    7171                        } 
    7272                } 
    73                 return airThroughput; 
     73                return airflow; 
    7474        } 
    7575 
    76         public double getPowerConsumption(AirThroughputStateName state) throws NoSuchFieldException { 
     76        public double getPowerConsumption(AirflowStateName state) throws NoSuchFieldException { 
    7777                double powerConsumption = 0; 
    78                 if(supportAirThroughputState(state)){ 
    79                         for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){ 
    80                                 if(airFlowState.getName().equals(state.getName())){ 
    81                                         powerConsumption = airFlowState.getPowerUsage(); 
     78                if(supportAirflowState(state)){ 
     79                        for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 
     80                                if(airflowState.getName().equals(state.getLabel())){ 
     81                                        powerConsumption = airflowState.getPowerUsage(); 
    8282                                        break; 
    8383                                } 
     
    8787        } 
    8888         
    89         public AirFlowValue getRecentAirFlow() { 
    90                 AirFlowValue airFlow = null; 
    91                 int lastIdx = getAirFlowHistory().size() - 1; 
     89        public AirflowValue getRecentAirflow() { 
     90                AirflowValue airflow = null; 
     91                int lastIdx = getAirflowHistory().size() - 1; 
    9292                if(lastIdx >= 0) 
    93                         airFlow = getAirFlowHistory().get(lastIdx); 
     93                        airflow = getAirflowHistory().get(lastIdx); 
    9494                else {   
    9595                        try { 
    96                                 airFlow = new AirFlowValue(DateTimeUtils.currentTimeMillis(), getAirFlow(currentAirThroughputState)); 
     96                                airflow = new AirflowValue(DateTimeUtils.currentTimeMillis(), getAirflow(currentAirflowState)); 
    9797                        } catch (NoSuchFieldException e) { 
    9898                        } 
    9999                } 
    100                 return airFlow; 
     100                return airflow; 
    101101        } 
    102102         
    103         public List<AirFlowValue> getAirFlowHistory(){ 
    104                 return airThroughputProfile.getAirThroughputHistory(); 
     103        public List<AirflowValue> getAirflowHistory(){ 
     104                return airflowProfile.getAirflowHistory(); 
    105105        } 
    106106         
    107107         
    108108        public Parameters getParameters() { 
    109                 return airThroughputProfile.getParameters(); 
     109                return airflowProfile.getParameters(); 
    110110        } 
    111111 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/CustomPowerStateName.java

    r477 r1396  
    11package schedframe.resources.computing.profiles.energy.power; 
    22 
    3 public class UserPowerStateName implements PowerStateName { 
     3public class CustomPowerStateName implements PowerStateName { 
    44 
    55        protected String name; 
    66 
    7         public UserPowerStateName(String name) { 
     7        public CustomPowerStateName(String name) { 
    88                this.name = name; 
    99        } 
    1010 
    11         public String getName() { 
     11        public String getLabel() { 
    1212                return name; 
    1313        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerStateName.java

    r477 r1396  
    33public interface PowerStateName { 
    44         
    5         public String getName(); 
     5        public String getLabel(); 
    66 
    77} 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/PowerStateNameFactory.java

    r477 r1396  
    66        public static PowerStateName createPowerStateName (String powerStateName){ 
    77                 
    8                 if(powerStateName.equals(StandardPowerStateName.ON.getName())) 
     8                if(powerStateName.equals(StandardPowerStateName.ON.getLabel())) 
    99                        return StandardPowerStateName.ON; 
    1010                 
    11                 else if(powerStateName.equals(StandardPowerStateName.OFF.getName())) 
     11                else if(powerStateName.equals(StandardPowerStateName.OFF.getLabel())) 
    1212                        return StandardPowerStateName.OFF; 
    1313                 
    14                 else if(powerStateName.equals(StandardPowerStateName.HIBERNATE.getName())) 
     14                else if(powerStateName.equals(StandardPowerStateName.HIBERNATE.getLabel())) 
    1515                        return StandardPowerStateName.HIBERNATE; 
    1616                 
    17                 else if(powerStateName.equals(StandardPowerStateName.SLEEP.getName())) 
     17                else if(powerStateName.equals(StandardPowerStateName.SLEEP.getLabel())) 
    1818                        return StandardPowerStateName.SLEEP; 
    1919                 
    20                 else if(powerStateName.equals(StandardPowerStateName.SUSPEND.getName())) 
     20                else if(powerStateName.equals(StandardPowerStateName.SUSPEND.getLabel())) 
    2121                        return StandardPowerStateName.SUSPEND; 
    2222                 
    23                 else return new UserPowerStateName(powerStateName); 
     23                else return new CustomPowerStateName(powerStateName); 
    2424        } 
    2525} 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/StandardPowerStateName.java

    r477 r1396  
    1010        HIBERNATE; 
    1111 
    12         public String getName() { 
     12        public String getLabel() { 
    1313                return toString(); 
    1414        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/plugin/EnergyEstimationPlugin.java

    r1207 r1396  
    1010        public double estimatePowerConsumption(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource); 
    1111 
    12         public double estimateAirThroughput(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource); 
     12        public double estimateAirflow(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource); 
    1313 
    1414        public double estimateTemperature(EnergyEvent event, JobRegistry jobRegistry, PhysicalResource resource); 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/computing/profiles/energy/power/ui/ComputingResourcePowerInterface.java

    r1374 r1396  
    7474        public boolean supportPowerState(PowerStateName state) { 
    7575                for(PowerState powerState: powerProfile.getSupportedPowerStates()){ 
    76                         if(powerState.getName().getName().equals(state.getName())){ 
     76                        if(powerState.getName().getLabel().equals(state.getLabel())){ 
    7777                                return true; 
    7878                        } 
     
    8686                if(supportPowerState(state)){ 
    8787                        for(PowerState powerState: powerProfile.getSupportedPowerStates()){ 
    88                                 if(powerState.getName().getName().equals(state.getName())){ 
     88                                if(powerState.getName().getLabel().equals(state.getLabel())){ 
    8989                                        powerConsumption = powerState.getPowerUsage(); 
    9090                                        break; 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/devices/Device.java

    r1207 r1396  
    2525                this.extensionList = new ExtensionListImpl(1); 
    2626                initCharacteristics(devDesc); 
    27                 accept(new EnergyExtension.Builder().resource(this).powerProfile(devDesc.getPowerProfile()).airFlowProfile(devDesc.getAirThroughputProfile()).thermalProfile(devDesc.getThermalProfile()).build());      
     27                accept(new EnergyExtension.Builder().resource(this).powerProfile(devDesc.getPowerProfile()).airflowProfile(devDesc.getAirflowProfile()).thermalProfile(devDesc.getThermalProfile()).build());    
    2828        } 
    2929 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/devices/DeviceAirflowInterface.java

    r1380 r1396  
    99import schedframe.resources.computing.profiles.energy.EnergyEvent; 
    1010import schedframe.resources.computing.profiles.energy.EnergyEventType; 
    11 import schedframe.resources.computing.profiles.energy.airthroughput.AirFlowValue; 
    12 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile; 
    13 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState; 
    14 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputStateName; 
    15 import schedframe.resources.computing.profiles.energy.airthroughput.StandardAirThroughputStateName; 
    16 import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface; 
     11import schedframe.resources.computing.profiles.energy.airthroughput.AirflowValue; 
     12import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile; 
     13import schedframe.resources.computing.profiles.energy.airthroughput.AirflowState; 
     14import schedframe.resources.computing.profiles.energy.airthroughput.AirflowStateName; 
     15import schedframe.resources.computing.profiles.energy.airthroughput.StandardAirflowStateName; 
     16import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirflowInterface; 
    1717 
    18 public class DeviceAirThroughputInterface implements AirThroughputInterface{ 
     18public class DeviceAirflowInterface implements AirflowInterface{ 
    1919 
    20         protected AirThroughputStateName currentAirThroughputState; 
    21         protected AirThroughputProfile airThroughputProfile; 
     20        protected AirflowStateName currentAirflowState; 
     21        protected AirflowProfile airflowProfile; 
    2222        protected PhysicalResource resource; 
    2323         
    24         public DeviceAirThroughputInterface(PhysicalResource resource, AirThroughputProfile airThroughputProfile){ 
     24        public DeviceAirflowInterface(PhysicalResource resource, AirflowProfile airflowProfile){ 
    2525                this.resource = resource; 
    26                 this.airThroughputProfile = airThroughputProfile; 
    27                 this.currentAirThroughputState = StandardAirThroughputStateName.ON; 
     26                this.airflowProfile = airflowProfile; 
     27                this.currentAirflowState = StandardAirflowStateName.ON; 
    2828        } 
    2929         
    30         public AirThroughputStateName getAirThroughputState() { 
    31                 return currentAirThroughputState; 
     30        public AirflowStateName getAirflowState() { 
     31                return currentAirflowState; 
    3232        } 
    3333 
    34         public boolean setAirThroughputState(AirThroughputStateName state) { 
    35                 if(supportAirThroughputState(state)){ 
    36                         currentAirThroughputState = state; 
     34        public boolean setAirflowState(AirflowStateName state) { 
     35                if(supportAirflowState(state)){ 
     36                        currentAirflowState = state; 
    3737                         
    3838                        //TO DO - notifications should be called for all resources starting form the lowest layer 
     
    4444        } 
    4545 
    46         public boolean supportAirThroughputState(AirThroughputStateName state) { 
    47                 for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){ 
    48                         if(airFlowState.getName().equals(state.getName())){ 
     46        public boolean supportAirflowState(AirflowStateName state) { 
     47                for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 
     48                        if(airflowState.getName().getLabel().equals(state.getLabel())){ 
    4949                                return true; 
    5050                        } 
     
    5353        } 
    5454 
    55         public List<AirThroughputState> getSupportedAirThroughputStates(){ 
    56                 List<AirThroughputState> airThroughputStates = new ArrayList<AirThroughputState>(); 
    57                 for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){ 
    58                         airThroughputStates.add(airFlowState); 
     55        public List<AirflowState> getSupportedAirflowStates(){ 
     56                List<AirflowState> airflowStates = new ArrayList<AirflowState>(); 
     57                for(AirflowState airFlowState: airflowProfile.getAirflowStates()){ 
     58                        airflowStates.add(airFlowState); 
    5959                } 
    60                 return airThroughputStates; 
     60                return airflowStates; 
    6161        } 
    6262 
    63         public double getAirFlow(AirThroughputStateName state) throws NoSuchFieldException { 
    64                 double airThroughput = 0; 
    65                 if(supportAirThroughputState(state)){ 
    66                         for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){ 
    67                                 if(airFlowState.getName().equals(state.getName())){ 
    68                                         airThroughput = airFlowState.getValue(); 
     63        public double getAirflow(AirflowStateName state) throws NoSuchFieldException { 
     64                double airflow = 0; 
     65                if(supportAirflowState(state)){ 
     66                        for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 
     67                                if(airflowState.getName().getLabel().equals(state.getLabel())){ 
     68                                        airflow = airflowState.getValue(); 
    6969                                        break; 
    7070                                } 
    7171                        } 
    7272                } 
    73                 return airThroughput; 
     73                return airflow; 
    7474        } 
    7575 
    76         public double getPowerConsumption(AirThroughputStateName state) throws NoSuchFieldException { 
     76        public double getPowerConsumption(AirflowStateName state) throws NoSuchFieldException { 
    7777                double powerConsumption = 0; 
    78                 if(supportAirThroughputState(state)){ 
    79                         for(AirThroughputState airFlowState: airThroughputProfile.getAirThroughputStates()){ 
    80                                 if(airFlowState.getName().equals(state.getName())){ 
    81                                         powerConsumption = airFlowState.getPowerUsage(); 
     78                if(supportAirflowState(state)){ 
     79                        for(AirflowState airflowState: airflowProfile.getAirflowStates()){ 
     80                                if(airflowState.getName().getLabel().equals(state.getLabel())){ 
     81                                        powerConsumption = airflowState.getPowerUsage(); 
    8282                                        break; 
    8383                                } 
     
    8787        } 
    8888         
    89         public AirFlowValue getRecentAirFlow() { 
    90                 AirFlowValue airFlow = null; 
    91                 int lastIdx = getAirFlowHistory().size() - 1; 
     89        public AirflowValue getRecentAirflow() { 
     90                AirflowValue airflow = null; 
     91                int lastIdx = getAirflowHistory().size() - 1; 
    9292                if(lastIdx >= 0) 
    93                         airFlow = getAirFlowHistory().get(lastIdx); 
     93                        airflow = getAirflowHistory().get(lastIdx); 
    9494                else {   
    9595                        try { 
    96                                 airFlow = new AirFlowValue(DateTimeUtils.currentTimeMillis(), getAirFlow(currentAirThroughputState)); 
     96                                airflow = new AirflowValue(DateTimeUtils.currentTimeMillis(), getAirflow(currentAirflowState)); 
    9797                        } catch (NoSuchFieldException e) { 
    9898                        } 
    9999                } 
    100                 return airFlow; 
     100                return airflow; 
    101101        } 
    102102         
    103         public List<AirFlowValue> getAirFlowHistory(){ 
    104                 return airThroughputProfile.getAirThroughputHistory(); 
     103        public List<AirflowValue> getAirflowHistory(){ 
     104                return airflowProfile.getAirflowHistory(); 
    105105        } 
    106106         
    107107        public Parameters getParameters() { 
    108                 return airThroughputProfile.getParameters(); 
     108                return airflowProfile.getParameters(); 
    109109        } 
    110110 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/devices/PhysicalResource.java

    r1287 r1396  
    1212import schedframe.resources.computing.extensions.ExtensionType; 
    1313import schedframe.resources.computing.profiles.energy.EnergyExtension; 
    14 import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirThroughputInterface; 
     14import schedframe.resources.computing.profiles.energy.airthroughput.ui.AirflowInterface; 
    1515import schedframe.resources.computing.profiles.energy.power.ui.PowerInterface; 
    1616import schedframe.resources.computing.profiles.energy.thermal.ui.ThermalInterface; 
     
    7070        } 
    7171         
    72         public AirThroughputInterface getAirThroughputInterface(){ 
     72        public AirflowInterface getAirflowInterface(){ 
    7373                Extension extension = getExtension(ExtensionType.ENERGY_EXTENSION); 
    7474                if(extension != null){ 
    7575                        EnergyExtension ee = (EnergyExtension)extension; 
    76                         return ee.getAirThroughputInterface(); 
     76                        return ee.getAirflowInterface(); 
    7777                } 
    7878                return null; 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/devices/coolemall/FanAirflowInterface.java

    r1317 r1396  
    11package schedframe.resources.devices.coolemall; 
    22 
    3 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile; 
    4 import schedframe.resources.computing.profiles.energy.airthroughput.UserAirThroughputStateName; 
     3import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile; 
     4import schedframe.resources.computing.profiles.energy.airthroughput.CustomAirflowStateName; 
    55import schedframe.resources.devices.PhysicalResource; 
    6 import schedframe.resources.devices.DeviceAirThroughputInterface; 
     6import schedframe.resources.devices.DeviceAirflowInterface; 
    77 
    8 public class FanAirThroughputInterface extends DeviceAirThroughputInterface { 
     8public class FanAirflowInterface extends DeviceAirflowInterface { 
    99 
    10         public FanAirThroughputInterface(PhysicalResource resource, AirThroughputProfile airThroughputProfile) { 
    11                 super(resource, airThroughputProfile); 
    12                 this.currentAirThroughputState = new UserAirThroughputStateName("2"); 
     10        public FanAirflowInterface(PhysicalResource resource, AirflowProfile airflowProfile) { 
     11                super(resource, airflowProfile); 
     12                this.currentAirflowState = new CustomAirflowStateName("2"); 
    1313        } 
    1414         
    1515        public boolean turnOn(){ 
    16                 return setAirThroughputState(new UserAirThroughputStateName("2")); 
     16                return setAirflowState(new CustomAirflowStateName("2")); 
    1717        } 
    1818 
    1919        public boolean turnOff(){ 
    20                 return setAirThroughputState(new UserAirThroughputStateName("1")); 
     20                return setAirflowState(new CustomAirflowStateName("1")); 
    2121        } 
    2222} 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java

    r1317 r1396  
    1010import schedframe.resources.computing.description.ResourceDescription; 
    1111import schedframe.resources.computing.location.Location; 
    12 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputProfile; 
    13 import schedframe.resources.computing.profiles.energy.airthroughput.AirThroughputState; 
    14 import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirThroughputEstimationPlugin; 
    15 import schedframe.resources.computing.profiles.energy.airthroughput.plugin.DefaultAirThroughputEstimationPlugin; 
     12import schedframe.resources.computing.profiles.energy.airthroughput.AirflowStateNameFactory; 
     13import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile; 
     14import schedframe.resources.computing.profiles.energy.airthroughput.AirflowState; 
     15import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirflowEstimationPlugin; 
     16import schedframe.resources.computing.profiles.energy.airthroughput.plugin.DefaultAirflowEstimationPlugin; 
    1617import schedframe.resources.computing.profiles.energy.power.PState; 
    1718import schedframe.resources.computing.profiles.energy.power.PowerProfile; 
     
    3637 
    3738        protected PowerProfile powerProfile; 
    38         protected AirThroughputProfile airThroughputProfile; 
     39        protected AirflowProfile airflowProfile; 
    3940        protected ThermalProfile thermalProfile; 
    4041        protected LoadProfile loadProfile; 
     
    5859                if (profile != null) { 
    5960                        initPowerProfile(profile.getPowerProfile()); 
    60                         initAirThroughputProfile(profile.getAirThroughputProfile()); 
     61                        initAirflowProfile(profile.getAirThroughputProfile()); 
    6162                        initThermalProfile(profile.getThermalProfile()); 
    6263                        initLoadProfile(profile.getLoadProfile()); 
     
    151152        } 
    152153 
    153         protected void initAirThroughputProfile(schemas.AirThroughputProfile airThroughputProfile) { 
    154                 if (airThroughputProfile != null) { 
    155                          
    156                         AirThroughputEstimationPlugin airThroughputEstimationPlugin = null; 
    157                         List<AirThroughputState> airThroughputStates = null; 
    158                         if(airThroughputProfile.getAirThroughputEstimationPlugin() != null){ 
    159                                 String airThroughputEstimationPluginName = airThroughputProfile.getAirThroughputEstimationPlugin().getName(); 
    160                                 if(airThroughputEstimationPluginName != null) { 
    161                                         airThroughputEstimationPlugin = (AirThroughputEstimationPlugin) InstanceFactory.createInstance( 
    162                                                         airThroughputEstimationPluginName, AirThroughputEstimationPlugin.class);                         
     154        protected void initAirflowProfile(schemas.AirThroughputProfile airflowProfile) { 
     155                if (airflowProfile != null) { 
     156                         
     157                        AirflowEstimationPlugin airflowEstimationPlugin = null; 
     158                        List<AirflowState> airflowStates = null; 
     159                        if(airflowProfile.getAirThroughputEstimationPlugin() != null){ 
     160                                String airflowEstimationPluginName = airflowProfile.getAirThroughputEstimationPlugin().getName(); 
     161                                if(airflowEstimationPluginName != null) { 
     162                                        airflowEstimationPlugin = (AirflowEstimationPlugin) InstanceFactory.createInstance( 
     163                                                        airflowEstimationPluginName, AirflowEstimationPlugin.class);                     
    163164                                } else { 
    164                                         airThroughputEstimationPlugin = new DefaultAirThroughputEstimationPlugin(); 
    165                                 } 
    166                                 Parameters params = extractParameters(airThroughputProfile.getAirThroughputEstimationPlugin().getParameter()); 
    167                                 airThroughputEstimationPlugin.init(params); 
    168                         } 
    169                         if(airThroughputProfile.getAirThroughputStates() != null){ 
    170                                 airThroughputStates = new ArrayList<AirThroughputState>(); 
    171                                 int airThrouhputStateCount = airThroughputProfile.getAirThroughputStates().getAirThroughputStateCount(); 
    172                                 for (int i = 0; i < airThrouhputStateCount; i++) { 
    173                                         schemas.AirThroughputState ats = airThroughputProfile.getAirThroughputStates().getAirThroughputState(i); 
    174                                         AirThroughputState airThroughputState = new AirThroughputState(ats.getName(), ats.getValue() 
     165                                        airflowEstimationPlugin = new DefaultAirflowEstimationPlugin(); 
     166                                } 
     167                                Parameters params = extractParameters(airflowProfile.getAirThroughputEstimationPlugin().getParameter()); 
     168                                airflowEstimationPlugin.init(params); 
     169                        } 
     170                        if(airflowProfile.getAirThroughputStates() != null){ 
     171                                airflowStates = new ArrayList<AirflowState>(); 
     172                                int airflowStateCount = airflowProfile.getAirThroughputStates().getAirThroughputStateCount(); 
     173                                for (int i = 0; i < airflowStateCount; i++) { 
     174                                        schemas.AirThroughputState ats = airflowProfile.getAirThroughputStates().getAirThroughputState(i); 
     175                                        AirflowState airflowState = new AirflowState(AirflowStateNameFactory.createAirflowStateName(ats.getName()), ats.getValue() 
    175176                                                        .getContent(), ats.getPowerUsage().getContent()); 
    176177                                        Parameters params = extractParameters(ats.getParameter()); 
    177                                         airThroughputState.init(params); 
    178                                         airThroughputStates.add(airThroughputState); 
    179                                 } 
    180                         } 
    181                         this.airThroughputProfile = new AirThroughputProfile(airThroughputEstimationPlugin, airThroughputStates); 
    182                         Parameters params = extractParameters(airThroughputProfile.getParameter()); 
    183                         this.airThroughputProfile.init(params); 
     178                                        airflowState.init(params); 
     179                                        airflowStates.add(airflowState); 
     180                                } 
     181                        } 
     182                        this.airflowProfile = new AirflowProfile(airflowEstimationPlugin, airflowStates); 
     183                        Parameters params = extractParameters(airflowProfile.getParameter()); 
     184                        this.airflowProfile.init(params); 
    184185                } 
    185186        } 
     
    281282        } 
    282283 
    283         public AirThroughputProfile getAirThroughputProfile() { 
    284                 return airThroughputProfile; 
     284        public AirflowProfile getAirflowProfile() { 
     285                return airflowProfile; 
    285286        } 
    286287 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/units/CustomResourceUnitName.java

    r477 r1396  
    11package schedframe.resources.units; 
    22 
    3 public class UserResourceUnitName implements ResourceUnitName { 
     3public class CustomResourceUnitName implements ResourceUnitName { 
    44 
    55        protected String name; 
    66 
    7         public UserResourceUnitName(String name) { 
     7        public CustomResourceUnitName(String name) { 
    88                this.name = name; 
    99        } 
    1010 
    11         public String getName() { 
     11        public String getLabel() { 
    1212                return name; 
    1313        } 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitFactory.java

    r1384 r1396  
    1818         
    1919        public static ResourceUnit createUnit(String unitName, String resId, int totalAmount, int usedAmount){ 
    20                 if(unitName.equalsIgnoreCase(StandardResourceUnitName.CPU.getName())) 
     20                if(unitName.equalsIgnoreCase(StandardResourceUnitName.CPU.getLabel())) 
    2121                        return new PEUnit(resId, totalAmount, usedAmount); 
    22                 if(unitName.equalsIgnoreCase(StandardResourceUnitName.PE.getName())) 
     22                if(unitName.equalsIgnoreCase(StandardResourceUnitName.PE.getLabel())) 
    2323                        return new PEUnit(resId, totalAmount, usedAmount); 
    24                 else if(unitName.equalsIgnoreCase(StandardResourceUnitName.MEMORY.getName())) 
     24                else if(unitName.equalsIgnoreCase(StandardResourceUnitName.MEMORY.getLabel())) 
    2525                         return new Memory(resId, totalAmount, usedAmount); 
    26                 else if(unitName.equalsIgnoreCase(StandardResourceUnitName.STORAGE.getName())) 
     26                else if(unitName.equalsIgnoreCase(StandardResourceUnitName.STORAGE.getLabel())) 
    2727                         return new Storage(resId, totalAmount, usedAmount); 
    28                 else if(unitName.equalsIgnoreCase(StandardResourceUnitName.GPU.getName())) 
     28                else if(unitName.equalsIgnoreCase(StandardResourceUnitName.GPU.getLabel())) 
    2929                         return new GPU(resId, totalAmount, usedAmount); 
    30                 else if (unitName.equalsIgnoreCase(StandardResourceUnitName.CPUSPEED.getName())) 
     30                else if (unitName.equalsIgnoreCase(StandardResourceUnitName.CPUSPEED.getLabel())) 
    3131                        return new CpuSpeed(resId, totalAmount, usedAmount);  
    32                 else if (unitName.equalsIgnoreCase(StandardResourceUnitName.COST.getName())) 
     32                else if (unitName.equalsIgnoreCase(StandardResourceUnitName.COST.getLabel())) 
    3333                        return new Cost(resId, totalAmount); 
    34                 else if (unitName.equalsIgnoreCase(StandardResourceUnitName.APPLICATION.getName())) 
     34                else if (unitName.equalsIgnoreCase(StandardResourceUnitName.APPLICATION.getLabel())) 
    3535                        return new Applications(resId);  
    3636                else 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitName.java

    r477 r1396  
    33public interface ResourceUnitName { 
    44         
    5         public String getName(); 
     5        public String getLabel(); 
    66 
    77} 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/units/ResourceUnitNameFactory.java

    r477 r1396  
    66        public static ResourceUnitName createResourceUnitName(String unitName){ 
    77 
    8                 if(unitName.equals(StandardResourceUnitName.MEMORY.getName())) 
     8                if(unitName.equals(StandardResourceUnitName.MEMORY.getLabel())) 
    99                        return StandardResourceUnitName.MEMORY; 
    1010                 
    11                 else if (unitName.equals(StandardResourceUnitName.STORAGE.getName())) 
     11                else if (unitName.equals(StandardResourceUnitName.STORAGE.getLabel())) 
    1212                        return StandardResourceUnitName.STORAGE; 
    1313                 
    14                 else if (unitName.equals(StandardResourceUnitName.PE.getName())) 
     14                else if (unitName.equals(StandardResourceUnitName.PE.getLabel())) 
    1515                        return StandardResourceUnitName.PE; 
    1616                 
    17                 else if (unitName.equals(StandardResourceUnitName.CPUSPEED.getName())) 
     17                else if (unitName.equals(StandardResourceUnitName.CPUSPEED.getLabel())) 
    1818                        return StandardResourceUnitName.CPUSPEED; 
    1919                 
    20                 else if (unitName.equals(StandardResourceUnitName.GPU.getName())) 
     20                else if (unitName.equals(StandardResourceUnitName.GPU.getLabel())) 
    2121                        return StandardResourceUnitName.GPU; 
    2222                 
    23                 else if (unitName.equals(StandardResourceUnitName.APPLICATION.getName())) 
     23                else if (unitName.equals(StandardResourceUnitName.APPLICATION.getLabel())) 
    2424                        return StandardResourceUnitName.APPLICATION; 
    2525                 
    26                 else if (unitName.equals(StandardResourceUnitName.COST.getName())) 
     26                else if (unitName.equals(StandardResourceUnitName.COST.getLabel())) 
    2727                        return StandardResourceUnitName.COST; 
    2828 
    29                 else return new UserResourceUnitName(unitName); 
     29                else return new CustomResourceUnitName(unitName); 
    3030        } 
    3131} 
  • DCWoRMS/branches/coolemall/src/schedframe/resources/units/StandardResourceUnitName.java

    r477 r1396  
    4646    } 
    4747 
    48     public String getName(){ 
     48    public String getLabel(){ 
    4949        return this.name; 
    5050    } 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/GridResourceDiscovery.java

    r493 r1396  
    2020import schedframe.resources.units.ResourceUnitName; 
    2121import schedframe.scheduling.manager.resources.ResourceManager; 
    22 import schedframe.scheduling.plugin.grid.ModuleType; 
     22import schedframe.scheduling.plugin.ModuleType; 
    2323import schedframe.scheduling.plugin.grid.ResourceDiscovery; 
    2424import schedframe.scheduling.tasks.requirements.AbstractResourceRequirements; 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/ResourceItem.java

    r1362 r1396  
    22 
    33import java.util.HashSet; 
     4import java.util.LinkedList; 
     5import java.util.List; 
    46import java.util.Map; 
    57import java.util.Set; 
    68 
     9import schedframe.resources.computing.ComputingResource; 
     10import schedframe.resources.units.ProcessingElements; 
    711import schedframe.resources.units.ResourceUnit; 
    812import schedframe.resources.units.ResourceUnitName; 
     13import schedframe.resources.units.StandardResourceUnitName; 
    914 
    10 public class ResourceHistoryItem { 
     15public class ResourceItem { 
    1116 
    1217        protected Map<ResourceUnitName, ResourceUnit> usedResources; 
    1318        protected Set<String> visitedResources; 
    1419 
    15         public ResourceHistoryItem(Map<ResourceUnitName, ResourceUnit> usedResources){ 
     20        public ResourceItem(Map<ResourceUnitName, ResourceUnit> usedResources){ 
    1621                this.usedResources = usedResources; 
    1722                this.visitedResources = new HashSet<String>(); 
     23                saveResourceNames(); 
    1824        } 
    1925         
     
    2228        } 
    2329         
    24         public void trackResource(String resName){ 
    25                 visitedResources.add(resName); 
    26         } 
    27          
    28         public Set<String> getVisitedResources(){ 
     30        public Set<String> getResourceNames(){ 
    2931                return visitedResources; 
    3032        } 
    3133         
     34        private void saveResourceNames(){ 
     35                ProcessingElements pes = (ProcessingElements) usedResources.get(StandardResourceUnitName.PE); 
     36                for (ComputingResource resource : pes) { 
     37 
     38                        LinkedList<ComputingResource> toExamine = new LinkedList<ComputingResource>(); 
     39                        toExamine.push(resource); 
     40 
     41                        while (!toExamine.isEmpty()) { 
     42                                ComputingResource compResource = toExamine.pop(); 
     43                                List<ComputingResource> resources = compResource.getChildren(); 
     44                                if(resources.isEmpty()){ 
     45                                        if(!visitedResources.contains(compResource.getFullName())){ 
     46                                                visitedResources.add(compResource.getFullName()); 
     47                                        } 
     48                                } else { 
     49                                        for (int i = 0; i < resources.size(); i++) { 
     50                                                ComputingResource resourceChild = resources.get(i); 
     51                                                toExamine.addLast(resourceChild); 
     52                                        } 
     53                                } 
     54                        } 
     55                } 
     56        } 
    3257} 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/resources/LocalResourceManager.java

    r1392 r1396  
    306306                        for(ResourceUnitName resUnitName: resources.keySet()){ 
    307307                                ResourceUnit resUnit = resources.get(resUnitName); 
    308                                 if(resUnit.getName().getName().equals(StandardResourceUnitName.PE.getName())){ 
     308                                if(resUnit.getName().getLabel().equals(StandardResourceUnitName.PE.getLabel())){ 
    309309                                        ProcessingElements pe = (ProcessingElements)resUnit; 
    310310                                        for(ComputingResource cr: pe){ 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/manager/tasks/JobRegistryImpl.java

    r1362 r1396  
    5353                        for (ExecTask task: executables) { 
    5454                                if (task.getStatus() == status) { 
    55                                         Set<String> visitedResource = task.getAllocatedResources().getLast().getVisitedResources(); 
     55                                        Set<String> visitedResource = task.getAllocatedResources().getLast().getResourceNames(); 
    5656                                        for(String res: visitedResource){ 
    5757                                                if(res.contains(context)){ 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/Module.java

    r477 r1396  
    1 package schedframe.scheduling.plugin.grid; 
     1package schedframe.scheduling.plugin; 
    22 
    33import java.util.Properties; 
    4  
    5 import eduni.simjava.Sim_event; 
    64 
    75import schedframe.exceptions.ModuleException; 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/ModuleList.java

    r477 r1396  
    1 package schedframe.scheduling.plugin.grid; 
     1package schedframe.scheduling.plugin; 
    22 
    33import java.util.List; 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/ModuleListImpl.java

    r477 r1396  
    1 package schedframe.scheduling.plugin.grid; 
     1package schedframe.scheduling.plugin; 
    22 
    33import java.util.ArrayList; 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/ModuleType.java

    r777 r1396  
    1 package schedframe.scheduling.plugin.grid; 
     1package schedframe.scheduling.plugin; 
    22 
    3 import schedframe.StaticResourceLoadCalendar; 
     3 
     4import schedframe.scheduling.plugin.grid.ResourceDiscovery; 
    45import test.EventManager; 
    56 
     
    1314 
    1415        RESOURCE_DISCOVERY("Resource_discovery", ResourceDiscovery.class), 
    15         RESOURCE_CALENDAR("Resource calendar", StaticResourceLoadCalendar.class), 
    1616        EVENT_MANAGER("Event manager", EventManager.class); 
    1717        //DATA_MANAGER("Data Manager", DataManager.class), 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/SchedulingPlugin.java

    r516 r1396  
    77import schedframe.scheduling.manager.tasks.JobRegistry; 
    88import schedframe.scheduling.plan.SchedulingPlanInterface; 
    9 import schedframe.scheduling.plugin.grid.ModuleList; 
    109import schedframe.scheduling.queue.TaskQueueList; 
    1110 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/grid/ResourceDiscovery.java

    r477 r1396  
    66import schedframe.scheduling.SchedulerDescription; 
    77import schedframe.scheduling.SecurityContext; 
     8import schedframe.scheduling.plugin.Module; 
    89import schedframe.scheduling.tasks.requirements.AbstractResourceRequirements; 
    910 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/plugin/local/LocalSchedulingPlugin.java

    r515 r1396  
    55import schedframe.scheduling.manager.resources.ResourceManager; 
    66import schedframe.scheduling.manager.tasks.JobRegistry; 
     7import schedframe.scheduling.plugin.ModuleList; 
    78import schedframe.scheduling.plugin.SchedulingPlugin; 
    8 import schedframe.scheduling.plugin.grid.ModuleList; 
    99import schedframe.scheduling.queue.TaskQueueList; 
    1010 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/AbstractManagementSystem.java

    r1377 r1396  
    2323import schedframe.scheduling.plan.AllocationInterface; 
    2424import schedframe.scheduling.plan.SchedulingPlanInterface; 
     25import schedframe.scheduling.plugin.ModuleList; 
    2526import schedframe.scheduling.plugin.SchedulingPlugin; 
    2627import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin; 
    27 import schedframe.scheduling.plugin.grid.ModuleList; 
    2828import schedframe.scheduling.manager.resources.ResourceAllocation; 
    2929import schedframe.scheduling.queue.TaskQueue; 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/global/GridBroker.java

    r1385 r1396  
    1212import schedframe.scheduling.Scheduler; 
    1313import schedframe.scheduling.manager.resources.ManagedResources; 
     14import schedframe.scheduling.plugin.ModuleListImpl; 
    1415import schedframe.scheduling.plugin.SchedulingPlugin; 
    1516import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin; 
    16 import schedframe.scheduling.plugin.grid.ModuleListImpl; 
    1717import schedframe.scheduling.queue.TaskQueueList; 
    1818 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/policy/local/LocalManagementSystem.java

    r1392 r1396  
    44import java.util.HashMap; 
    55import java.util.Iterator; 
    6 import java.util.LinkedList; 
    76import java.util.List; 
    87import java.util.Map; 
    9 import java.util.Set; 
    108 
    119import org.apache.commons.logging.Log; 
     
    3331import schedframe.resources.units.StandardResourceUnitName; 
    3432import schedframe.scheduling.ExecutionHistoryItem; 
    35 import schedframe.scheduling.ResourceHistoryItem; 
     33import schedframe.scheduling.ResourceItem; 
    3634import schedframe.scheduling.Scheduler; 
    3735import schedframe.scheduling.TaskList; 
     
    4442import schedframe.scheduling.plan.ScheduledTaskInterface; 
    4543import schedframe.scheduling.plan.SchedulingPlanInterface; 
     44import schedframe.scheduling.plugin.ModuleListImpl; 
    4645import schedframe.scheduling.plugin.SchedulingPlugin; 
    4746import schedframe.scheduling.plugin.estimation.ExecutionTimeEstimationPlugin; 
    48 import schedframe.scheduling.plugin.grid.ModuleListImpl; 
    4947import schedframe.scheduling.policy.AbstractManagementSystem; 
    5048import schedframe.scheduling.queue.TaskQueueList; 
     
    5654import schedframe.scheduling.tasks.WorkloadUnit; 
    5755import simulator.DCWormsConstants; 
    58 import simulator.stats.GSSAccumulator; 
     56import simulator.stats.DCwormsAccumulator; 
    5957import simulator.utils.DoubleMath; 
    6058import dcworms.schedframe.scheduling.ExecTask; 
     
    382380 
    383381                saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration); 
    384                 if(exec.getResourceConsumptionProfile().isLast()){ 
     382                if(exec.getExecutionProfile().isLast()){ 
    385383                        scheduler.sendInternal(phaseDuration, DCWormsTags.TASK_EXECUTION_FINISHED, execTask);; 
    386384                } else { 
     
    451449                        ExecTask task = iter.next(); 
    452450                        Executable exec = (Executable)task; 
    453                         ExecutionHistoryItem execHistItem = exec.getExecHistory().getLast(); 
     451                        ExecutionHistoryItem execHistItem = exec.getExecutionHistory().getLast(); 
    454452                        //System.out.println("--- upadteProgressX: " + Sim_system.sim_clock() ); 
    455453                        //System.out.println("taskId: " + exec.getId() + "; completion percentage: " + exec.getCompletionPercentage() + "; timespan: " + timeSpan + "; estimatedDuration: " +  execHistItem.getCompletionPercentage()); 
     
    496494                                        execTask, choosenResources, exec.getCompletionPercentage())).intValue(); 
    497495 
    498                         ExecutionHistoryItem execHistItem = exec.getExecHistory().getLast(); 
     496                        ExecutionHistoryItem execHistItem = exec.getExecutionHistory().getLast(); 
    499497                        double lastTimeStamp = execHistItem.getTimeStamp().getMillis()/1000; 
    500498                        if(DoubleMath.subtract((lastTimeStamp + execHistItem.getEstimatedDuration()), (new DateTime().getMillis()/1000 + phaseDuration)) == 0.0){ 
     
    508506                        saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration); 
    509507                         
    510                         if(exec.getResourceConsumptionProfile().isLast()){ 
     508                        if(exec.getExecutionProfile().isLast()){ 
    511509                                ExecTaskFilter filter = new ExecTaskFilter(exec.getUniqueId(), DCWormsTags.TASK_EXECUTION_FINISHED); 
    512510                                scheduler.sim_cancel(filter, null); 
     
    542540                        saveExecutionHistory(exec, exec.getCompletionPercentage(), phaseDuration); 
    543541                         
    544                         if(exec.getResourceConsumptionProfile().isLast()){ 
     542                        if(exec.getExecutionProfile().isLast()){ 
    545543                                scheduler.sendInternal(phaseDuration, DCWormsTags.TASK_EXECUTION_FINISHED, execTask); 
    546544                        } else { 
     
    555553        public double calculateTotalLoad() { 
    556554 
    557                 GSSAccumulator loadAcc = new GSSAccumulator(); 
     555                DCwormsAccumulator loadAcc = new DCwormsAccumulator(); 
    558556                try { 
    559557                        for(ComputingResource compRes: getResourceManager().getResourcesOfType(StandardResourceType.Node)){ 
     
    718716                boolean allocationStatus = getAllocationManager().allocateResources(choosenResources, exclusive); 
    719717                if(allocationStatus){ 
    720                         ResourceHistoryItem resourceHistoryItem = new ResourceHistoryItem(choosenResources); 
     718                        ResourceItem resourceHistoryItem = new ResourceItem(choosenResources); 
    721719                        exec.addAllocatedResources(resourceHistoryItem); 
    722                         saveResourceHistory(exec); 
    723720                        return true; 
    724721                } 
     
    726723        } 
    727724         
    728         private void saveResourceHistory(Executable exec){ 
    729                 ProcessingElements pes = (ProcessingElements) exec.getAllocatedResources().getLast().getResourceUnits().get(StandardResourceUnitName.PE); 
    730                 for (ComputingResource resource : pes) { 
    731  
    732                         LinkedList<ComputingResource> toExamine = new LinkedList<ComputingResource>(); 
    733                         toExamine.push(resource); 
    734  
    735                         while (!toExamine.isEmpty()) { 
    736                                 ComputingResource compResource = toExamine.pop(); 
    737                                 List<ComputingResource> resources = compResource.getChildren(); 
    738                                 if(resources.isEmpty()){ 
    739                                         Set<String> visitedResources = exec.getAllocatedResources().getLast().getVisitedResources(); 
    740                                         if(!visitedResources.contains(compResource.getFullName())){ 
    741                                                 exec.getAllocatedResources().getLast().trackResource(compResource.getFullName()); 
    742                                         } 
    743                                 } else { 
    744                                         for (int i = 0; i < resources.size(); i++) { 
    745                                                 ComputingResource resourceChild = resources.get(i); 
    746                                                 toExamine.addLast(resourceChild); 
    747                                         } 
    748                                 } 
    749                         } 
    750                 } 
    751         } 
     725 
    752726         
    753727} 
  • DCWoRMS/branches/coolemall/src/schedframe/scheduling/tasks/Job.java

    r1374 r1396  
    11package schedframe.scheduling.tasks; 
    2  
    3  
    4 import org.qcg.broker.schemas.resreqs.ParentType; 
    5 import org.qcg.broker.schemas.resreqs.ResourceRequirements; 
    6 import org.qcg.broker.schemas.resreqs.Workflow; 
    7 import org.qcg.broker.schemas.resreqs.types.TaskStatesName; 
    82 
    93 
     
    159 
    1610import org.joda.time.DateTime; 
     11import org.qcg.broker.schemas.resreqs.ResourceRequirements; 
    1712 
    1813import qcg.shared.constants.BrokerConstants; 
    19  
    2014import schedframe.scheduling.WorkloadUnitHandler; 
    2115import schedframe.scheduling.manager.tasks.JobRegistryImpl; 
     
    210204        } 
    211205         
    212         private List<Task> getReadyTasks() throws NoSuchFieldException{ 
    213                  
    214                 List<Task> availableTasks = new ArrayList<Task>(); 
    215                 int size = tasks.size(); 
    216                  
    217                 for(int i = 0; i < size; i++){ 
    218                         int parCnt; 
    219                         int previousTaskSucceedCnt = 0; 
    220                         Task task = tasks.get(i); 
    221                         if(task.getStatus() != (int)BrokerConstants.TASK_STATUS_UNSUBMITTED) 
    222                                 continue; 
    223                         //the following procedure supports only one nested structure 
    224                         Workflow w = task.getDescription().getWorkflow(); 
    225                         if (w == null){ 
    226                                 availableTasks.add(task); 
    227                                 continue; 
    228                         } 
    229                         if(w.getAnd() != null) { 
    230                                 parCnt = w.getAnd().getParentOpTypeItemCount(); 
    231                                 if(parCnt == 0){ 
    232                                         availableTasks.add(task); 
    233                                 }else 
    234                                 { 
    235                                         for(int j = 0; j < parCnt; j++){ 
    236                                                 ParentType par = w.getAnd().getParentOpTypeItem(j).getParent(); 
    237                                                 if(par.getTriggerState().compareTo(TaskStatesName.FINISHED) == 0){ 
    238                                                         if(!getTask(par.getContent()).isFinished()){ 
    239                                                                 break; 
    240                                                         } 
    241                                                 } 
    242                                                 previousTaskSucceedCnt++; 
    243                                         } 
    244  
    245                                         if(previousTaskSucceedCnt == parCnt) 
    246                                                 availableTasks.add(task); 
    247                                 } 
    248                         }  
    249                         else if(w.getOr() != null) { 
    250                                 parCnt = w.getOr().getParentOpTypeItemCount(); 
    251                                 if(parCnt == 0){ 
    252                                         availableTasks.add(task); 
    253                                 } 
    254                                 else{ 
    255                                         for(int j = 0; j < parCnt; j++){ 
    256                                                 ParentType par = w.getOr().getParentOpTypeItem(j).getParent(); 
    257                                                 if(par.getTriggerState().compareTo(TaskStatesName.FINISHED) == 0){ 
    258                                                         if(!getTask(par.getContent()).isFinished()){ 
    259                                                                 continue; 
    260                                                         } 
    261                                                 } 
    262                                                 previousTaskSucceedCnt++; 
    263                                         } 
    264  
    265                                         if(previousTaskSucceedCnt > 0) 
    266                                                 availableTasks.add(task); 
    267                                 } 
    268                         } 
    269                         else { 
    270                                 parCnt = w.getParentCount(); 
    271                                 if(parCnt == 0){ 
    272                                         availableTasks.add(task); 
    273                                 }else{ 
    274                                         for(int j = 0; j < parCnt; j++){ 
    275                                                 ParentType par = w.getParent(j); 
    276                                                 if(par.getTriggerState().compareTo(TaskStatesName.FINISHED) == 0){ 
    277                                                         if(!getTask(par.getContent()).isFinished()){ 
    278                                                                 continue; 
    279                                                         } 
    280                                                 } 
    281                                                 previousTaskSucceedCnt++; 
    282                                         } 
    283  
    284                                         if(previousTaskSucceedCnt == parCnt) 
    285                                                 availableTasks.add(task); 
    286                                 } 
    287                         } 
    288                 }                
    289                 return availableTasks; 
    290         } 
    291          
    292206} 
Note: See TracChangeset for help on using the changeset viewer.