Changeset 241 for xssim/branches/tpiontek/src/test
- Timestamp:
- 04/11/12 16:30:38 (13 years ago)
- Location:
- xssim/branches/tpiontek/src/test/rewolucja
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
xssim/branches/tpiontek/src/test/rewolucja/energy/profile/implementation/CPUPowerProfile.java
r215 r241 31 31 powerState = PowerState.ON; 32 32 pState = getSupportedPStates().get(PStateType.P0); 33 //pState = getSupportedPStates().get(PStateType.P3); 33 34 } 34 35 … … 103 104 public boolean setPState(PStateType pStateType){ 104 105 PState newPState = getSupportedPStates().get(pStateType); 106 105 107 if(newPState != null) 106 108 { 107 double factor = pState.getFrequency()/newPState.getFrequency(); 109 double factor = newPState.getFrequency() / pState.getFrequency(); 110 108 111 pState = newPState; 109 112 CpuSpeed speed = (CpuSpeed )cpu.getResourceCharacteristic().getResourceUnits().get(ResourceParameterName.CPUSPEED).get(0); 110 //speed.setAmount((int)pState.getFrequency());111 113 speed.setAmount( (int)(speed.getAmount() * factor)); 114 112 115 cpu.handleEvent(new EnergyEvent(EnergyEventType.FREQUENCY_CHANGED, cpu.getName())); 113 116 cpu.getLogicalResource().sendInternal(GridSimTags.SCHEDULE_NOW, GssimTags.UPDATE, cpu.getName()); -
xssim/branches/tpiontek/src/test/rewolucja/energy/profile/implementation/CPU_A_PowerProfile.java
r131 r241 23 23 static { 24 24 Map<PStateType, PState> pStatesMap = new HashMap<PStateType, PState>(); 25 pStatesMap.put(PStateType.P0, new PState(PStateType.P0, 3000, 0, 350));26 pStatesMap.put(PStateType.P1, new PState(PStateType.P1, 2660, 0, 343));27 pStatesMap.put(PStateType.P2, new PState(PStateType.P2, 2330, 0, 337));28 pStatesMap.put(PStateType.P3, new PState(PStateType.P3, 2000, 0, 330));25 pStatesMap.put(PStateType.P0, new PState(PStateType.P0, 3000, 0, 14)); 26 pStatesMap.put(PStateType.P1, new PState(PStateType.P1, 2660, 0, 12)); 27 pStatesMap.put(PStateType.P2, new PState(PStateType.P2, 2330, 0, 10)); 28 pStatesMap.put(PStateType.P3, new PState(PStateType.P3, 2000, 0, 8)); 29 29 pStates = Collections.unmodifiableMap(pStatesMap); 30 30 } -
xssim/branches/tpiontek/src/test/rewolucja/energy/profile/implementation/CPU_B_PowerProfile.java
r131 r241 23 23 static { 24 24 Map<PStateType, PState> pStatesMap = new HashMap<PStateType, PState>(); 25 pStatesMap.put(PStateType.P0, new PState(PStateType.P0, 2 660, 0, 363));26 pStatesMap.put(PStateType.P1, new PState(PStateType.P1, 2 330, 0, 357));27 pStatesMap.put(PStateType.P2, new PState(PStateType.P2, 2000, 0, 350));28 pStatesMap.put(PStateType.P3, new PState(PStateType.P3, 1 860, 0, 343));25 pStatesMap.put(PStateType.P0, new PState(PStateType.P0, 2200, 0, 19)); 26 pStatesMap.put(PStateType.P1, new PState(PStateType.P1, 2000, 0, 16)); 27 pStatesMap.put(PStateType.P2, new PState(PStateType.P2, 1800, 0, 14)); 28 pStatesMap.put(PStateType.P3, new PState(PStateType.P3, 1000, 0, 10)); 29 29 pStates = Collections.unmodifiableMap(pStatesMap); 30 30 } -
xssim/branches/tpiontek/src/test/rewolucja/resources/physical/factory/ComputingNodeFactory.java
r104 r241 4 4 import schedframe.resources.units.Memory; 5 5 import test.rewolucja.resources.Category; 6 import test.rewolucja.resources.ResourceCharacteristics;7 6 import test.rewolucja.resources.description.ExecResourceDescription; 8 7 import test.rewolucja.resources.physical.base.ComputingResource; … … 37 36 String resName = resDesc.getResourceId(); 38 37 Category cat = resDesc.getCategory(); 39 if(cat.getName().equals("A")){ 40 resDesc.addResourceUnit(new Memory(resName, 12288, 0)); 38 39 if(cat.getName().equals("A")) 40 { 41 resDesc.addResourceUnit(new Memory(resName, 8704, 0)); 41 42 resDesc.addResourceUnit(new Cost(resName, 100)); 42 43 return new ComputingNode(resDesc); 43 } else if (cat.getName().equals("B")){ 44 resDesc.addResourceUnit(new Memory(resName, 12288, 0)); 44 } 45 else if (cat.getName().equals("B")) 46 { 47 resDesc.addResourceUnit(new Memory(resName, 6144, 0)); 45 48 resDesc.addResourceUnit(new Cost(resName, 100)); 46 49 return new ComputingNode(resDesc); 47 } else if (cat.getName().equals("C")){ 48 resDesc.addResourceUnit(new Memory(resName, 12288, 0)); 50 } 51 else if (cat.getName().equals("C")) 52 { 53 resDesc.addResourceUnit(new Memory(resName, 0, 0)); 49 54 resDesc.addResourceUnit(new Cost(resName, 100)); 50 55 return new ComputingNode(resDesc); 51 } else { 52 resDesc.addResourceUnit(new Memory(resName, 12288, 0)); 56 } 57 else 58 { 59 resDesc.addResourceUnit(new Memory(resName, 0, 0)); 53 60 resDesc.addResourceUnit(new Cost(resName, 100)); 54 61 return new ComputingNode(resDesc); -
xssim/branches/tpiontek/src/test/rewolucja/resources/physical/implementation/Processor.java
r220 r241 56 56 public void initCharacteristics(ExecResourceDescription resDesc){ 57 57 resourceCharacteristic = new ResourceCharacteristics(); 58 resourceCharacteristic.addResourceUnit(new CpuSpeed(name, 1, 0)); 58 59 int speed = 1000; 60 if( resDesc.getCategory().getName().equals("A")) 61 speed = 2000; 62 63 resourceCharacteristic.addResourceUnit(new CpuSpeed(name, speed, 0)); 59 64 } 60 65
Note: See TracChangeset
for help on using the changeset viewer.