Ignore:
Timestamp:
04/11/12 16:30:38 (13 years ago)
Author:
piontek
Message:
 
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  
    3131                powerState = PowerState.ON; 
    3232                pState = getSupportedPStates().get(PStateType.P0); 
     33                //pState = getSupportedPStates().get(PStateType.P3); 
    3334        } 
    3435 
     
    103104        public boolean setPState(PStateType pStateType){ 
    104105                PState newPState = getSupportedPStates().get(pStateType); 
     106                 
    105107                if(newPState != null) 
    106108                { 
    107                         double factor = pState.getFrequency()/newPState.getFrequency(); 
     109                        double factor = newPState.getFrequency() / pState.getFrequency(); 
     110                         
    108111                        pState = newPState; 
    109112                        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                         
    112115                        cpu.handleEvent(new EnergyEvent(EnergyEventType.FREQUENCY_CHANGED, cpu.getName())); 
    113116                        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  
    2323                static { 
    2424                        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)); 
    2929                        pStates = Collections.unmodifiableMap(pStatesMap); 
    3030                } 
  • xssim/branches/tpiontek/src/test/rewolucja/energy/profile/implementation/CPU_B_PowerProfile.java

    r131 r241  
    2323                static { 
    2424                        Map<PStateType, PState> pStatesMap = new HashMap<PStateType, PState>(); 
    25                         pStatesMap.put(PStateType.P0, new PState(PStateType.P0, 2660, 0, 363)); 
    26                         pStatesMap.put(PStateType.P1, new PState(PStateType.P1, 2330, 0, 357)); 
    27                         pStatesMap.put(PStateType.P2, new PState(PStateType.P2, 2000, 0, 350)); 
    28                         pStatesMap.put(PStateType.P3, new PState(PStateType.P3, 1860, 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)); 
    2929                        pStates = Collections.unmodifiableMap(pStatesMap); 
    3030                } 
  • xssim/branches/tpiontek/src/test/rewolucja/resources/physical/factory/ComputingNodeFactory.java

    r104 r241  
    44import schedframe.resources.units.Memory; 
    55import test.rewolucja.resources.Category; 
    6 import test.rewolucja.resources.ResourceCharacteristics; 
    76import test.rewolucja.resources.description.ExecResourceDescription; 
    87import test.rewolucja.resources.physical.base.ComputingResource; 
     
    3736                String resName = resDesc.getResourceId(); 
    3837                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)); 
    4142                        resDesc.addResourceUnit(new Cost(resName, 100)); 
    4243                        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)); 
    4548                        resDesc.addResourceUnit(new Cost(resName, 100)); 
    4649                        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)); 
    4954                        resDesc.addResourceUnit(new Cost(resName, 100)); 
    5055                        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)); 
    5360                        resDesc.addResourceUnit(new Cost(resName, 100)); 
    5461                        return new ComputingNode(resDesc); 
  • xssim/branches/tpiontek/src/test/rewolucja/resources/physical/implementation/Processor.java

    r220 r241  
    5656        public void initCharacteristics(ExecResourceDescription resDesc){ 
    5757                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)); 
    5964        } 
    6065         
Note: See TracChangeset for help on using the changeset viewer.