- Timestamp:
- 03/19/14 18:22:27 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DCWoRMS/branches/coolemall/src/schedframe/resources/computing/coolemall/NodeGroup.java
r1247 r1299 1 1 package schedframe.resources.computing.coolemall; 2 2 3 import java.util.ArrayList; 3 4 import java.util.List; 4 5 … … 8 9 import schedframe.resources.computing.Processor; 9 10 import schedframe.resources.computing.description.ComputingResourceDescription; 11 import schedframe.resources.computing.description.ResourceDescription; 12 import schedframe.resources.devices.Device; 13 import schedframe.resources.devices.Fan; 14 import test.Node_Fan_Mapping; 10 15 11 16 public class NodeGroup extends ComputingResource{ … … 13 18 public NodeGroup(ComputingResourceDescription resDesc) { 14 19 super(resDesc); 20 initNodes_FansMapping(resDesc); 15 21 } 16 22 … … 25 31 } 26 32 33 34 private void initNodes_FansMapping(ComputingResourceDescription resDesc){ 35 Node_Fan_Mapping.init(); 36 for(Device dev: this.getResourceCharacteristic().getDevices()){ 37 if(dev.getType().equals(StandardResourceType.Fan) || dev.getType().equals(StandardResourceType.Inlet) | dev.getType().equals(StandardResourceType.Outlet)){ 38 Fan fan = (Fan) dev; 39 List<String> chilledResources = new ArrayList<String>(); 40 for(ResourceDescription nodeDesc: resDesc.getChildren()){ 41 String nodeName = this.getFullName() + "/" + nodeDesc.getId(); 42 if(!Node_Fan_Mapping.getNode_fan().containsKey(nodeName)){ 43 chilledResources.add(nodeName); 44 } else if(Node_Fan_Mapping.getNode_fan().get(nodeName).equals(fan.getFullName())){ 45 chilledResources.add(nodeName); 46 } else { 47 //if mapping present but there is no match do nothing 48 } 49 } 50 fan.setChilledResources(chilledResources); 51 } 52 } 53 } 27 54 }
Note: See TracChangeset
for help on using the changeset viewer.