- Timestamp:
- 06/26/14 14:18:01 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/schedframe/resources/devices/description/PhysicalResourceDescription.java
r1317 r1396 10 10 import schedframe.resources.computing.description.ResourceDescription; 11 11 import 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; 12 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowStateNameFactory; 13 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowProfile; 14 import schedframe.resources.computing.profiles.energy.airthroughput.AirflowState; 15 import schedframe.resources.computing.profiles.energy.airthroughput.plugin.AirflowEstimationPlugin; 16 import schedframe.resources.computing.profiles.energy.airthroughput.plugin.DefaultAirflowEstimationPlugin; 16 17 import schedframe.resources.computing.profiles.energy.power.PState; 17 18 import schedframe.resources.computing.profiles.energy.power.PowerProfile; … … 36 37 37 38 protected PowerProfile powerProfile; 38 protected Air ThroughputProfile airThroughputProfile;39 protected AirflowProfile airflowProfile; 39 40 protected ThermalProfile thermalProfile; 40 41 protected LoadProfile loadProfile; … … 58 59 if (profile != null) { 59 60 initPowerProfile(profile.getPowerProfile()); 60 initAir ThroughputProfile(profile.getAirThroughputProfile());61 initAirflowProfile(profile.getAirThroughputProfile()); 61 62 initThermalProfile(profile.getThermalProfile()); 62 63 initLoadProfile(profile.getLoadProfile()); … … 151 152 } 152 153 153 protected void initAir ThroughputProfile(schemas.AirThroughputProfile airThroughputProfile) {154 if (air ThroughputProfile != null) {155 156 Air ThroughputEstimationPlugin airThroughputEstimationPlugin = null;157 List<Air ThroughputState> airThroughputStates = null;158 if(air ThroughputProfile.getAirThroughputEstimationPlugin() != null){159 String air ThroughputEstimationPluginName = airThroughputProfile.getAirThroughputEstimationPlugin().getName();160 if(air ThroughputEstimationPluginName != null) {161 air ThroughputEstimationPlugin = (AirThroughputEstimationPlugin) InstanceFactory.createInstance(162 air ThroughputEstimationPluginName, 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); 163 164 } else { 164 air ThroughputEstimationPlugin = new DefaultAirThroughputEstimationPlugin();165 } 166 Parameters params = extractParameters(air ThroughputProfile.getAirThroughputEstimationPlugin().getParameter());167 air ThroughputEstimationPlugin.init(params);168 } 169 if(air ThroughputProfile.getAirThroughputStates() != null){170 air ThroughputStates = new ArrayList<AirThroughputState>();171 int air ThrouhputStateCount = airThroughputProfile.getAirThroughputStates().getAirThroughputStateCount();172 for (int i = 0; i < air ThrouhputStateCount; i++) {173 schemas.AirThroughputState ats = air ThroughputProfile.getAirThroughputStates().getAirThroughputState(i);174 Air ThroughputState 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() 175 176 .getContent(), ats.getPowerUsage().getContent()); 176 177 Parameters params = extractParameters(ats.getParameter()); 177 air ThroughputState.init(params);178 air ThroughputStates.add(airThroughputState);179 } 180 } 181 this.air ThroughputProfile = new AirThroughputProfile(airThroughputEstimationPlugin, airThroughputStates);182 Parameters params = extractParameters(air ThroughputProfile.getParameter());183 this.air ThroughputProfile.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); 184 185 } 185 186 } … … 281 282 } 282 283 283 public Air ThroughputProfile getAirThroughputProfile() {284 return air ThroughputProfile;284 public AirflowProfile getAirflowProfile() { 285 return airflowProfile; 285 286 } 286 287
Note: See TracChangeset
for help on using the changeset viewer.