Commit e3c84dfc authored by Anton Beloglazov's avatar Anton Beloglazov

- Examples updated, but still need to fix the SingleThreshold example

parent 5c168e18
...@@ -21,6 +21,7 @@ import org.cloudbus.cloudsim.CloudletSchedulerDynamicWorkload; ...@@ -21,6 +21,7 @@ import org.cloudbus.cloudsim.CloudletSchedulerDynamicWorkload;
import org.cloudbus.cloudsim.DatacenterBroker; import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.DatacenterCharacteristics; import org.cloudbus.cloudsim.DatacenterCharacteristics;
import org.cloudbus.cloudsim.Log; import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.Pe;
import org.cloudbus.cloudsim.Storage; import org.cloudbus.cloudsim.Storage;
import org.cloudbus.cloudsim.UtilizationModelStochastic; import org.cloudbus.cloudsim.UtilizationModelStochastic;
import org.cloudbus.cloudsim.Vm; import org.cloudbus.cloudsim.Vm;
...@@ -28,7 +29,6 @@ import org.cloudbus.cloudsim.VmSchedulerTimeShared; ...@@ -28,7 +29,6 @@ import org.cloudbus.cloudsim.VmSchedulerTimeShared;
import org.cloudbus.cloudsim.core.CloudSim; import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.power.PowerDatacenter; import org.cloudbus.cloudsim.power.PowerDatacenter;
import org.cloudbus.cloudsim.power.PowerHost; import org.cloudbus.cloudsim.power.PowerHost;
import org.cloudbus.cloudsim.power.PowerPe;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicySingleThreshold; import org.cloudbus.cloudsim.power.PowerVmAllocationPolicySingleThreshold;
import org.cloudbus.cloudsim.power.models.PowerModelLinear; import org.cloudbus.cloudsim.power.models.PowerModelLinear;
import org.cloudbus.cloudsim.provisioners.BwProvisionerSimple; import org.cloudbus.cloudsim.provisioners.BwProvisionerSimple;
...@@ -235,8 +235,8 @@ public class DVFS { ...@@ -235,8 +235,8 @@ public class DVFS {
// 2. A Machine contains one or more PEs or CPUs/Cores. // 2. A Machine contains one or more PEs or CPUs/Cores.
// In this example, it will have only one core. // In this example, it will have only one core.
// 3. Create PEs and add these into an object of PowerPeList. // 3. Create PEs and add these into an object of PowerPeList.
List<PowerPe> peList = new ArrayList<PowerPe>(); List<Pe> peList = new ArrayList<Pe>();
peList.add(new PowerPe(0, new PeProvisionerSimple(mips[i % mips.length]), new PowerModelLinear(maxPower, staticPowerPercent))); // need to store PowerPe id and MIPS Rating peList.add(new Pe(0, new PeProvisionerSimple(mips[i % mips.length]))); // need to store PowerPe id and MIPS Rating
// 4. Create PowerHost with its id and list of PEs and add them to the list of machines // 4. Create PowerHost with its id and list of PEs and add them to the list of machines
...@@ -247,7 +247,8 @@ public class DVFS { ...@@ -247,7 +247,8 @@ public class DVFS {
new BwProvisionerSimple(bw), new BwProvisionerSimple(bw),
storage, storage,
peList, peList,
new VmSchedulerTimeShared(peList) new VmSchedulerTimeShared(peList),
new PowerModelLinear(maxPower, staticPowerPercent)
) )
); // This is our machine ); // This is our machine
} }
......
...@@ -21,6 +21,7 @@ import org.cloudbus.cloudsim.CloudletSchedulerDynamicWorkload; ...@@ -21,6 +21,7 @@ import org.cloudbus.cloudsim.CloudletSchedulerDynamicWorkload;
import org.cloudbus.cloudsim.DatacenterBroker; import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.DatacenterCharacteristics; import org.cloudbus.cloudsim.DatacenterCharacteristics;
import org.cloudbus.cloudsim.Log; import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.Pe;
import org.cloudbus.cloudsim.Storage; import org.cloudbus.cloudsim.Storage;
import org.cloudbus.cloudsim.UtilizationModelStochastic; import org.cloudbus.cloudsim.UtilizationModelStochastic;
import org.cloudbus.cloudsim.Vm; import org.cloudbus.cloudsim.Vm;
...@@ -29,7 +30,6 @@ import org.cloudbus.cloudsim.core.CloudSim; ...@@ -29,7 +30,6 @@ import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.power.PowerDatacenter; import org.cloudbus.cloudsim.power.PowerDatacenter;
import org.cloudbus.cloudsim.power.PowerDatacenterNonPowerAware; import org.cloudbus.cloudsim.power.PowerDatacenterNonPowerAware;
import org.cloudbus.cloudsim.power.PowerHost; import org.cloudbus.cloudsim.power.PowerHost;
import org.cloudbus.cloudsim.power.PowerPe;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicySingleThreshold; import org.cloudbus.cloudsim.power.PowerVmAllocationPolicySingleThreshold;
import org.cloudbus.cloudsim.power.models.PowerModelLinear; import org.cloudbus.cloudsim.power.models.PowerModelLinear;
import org.cloudbus.cloudsim.provisioners.BwProvisionerSimple; import org.cloudbus.cloudsim.provisioners.BwProvisionerSimple;
...@@ -234,8 +234,8 @@ public class NonPowerAware { ...@@ -234,8 +234,8 @@ public class NonPowerAware {
// 2. A Machine contains one or more PEs or CPUs/Cores. // 2. A Machine contains one or more PEs or CPUs/Cores.
// In this example, it will have only one core. // In this example, it will have only one core.
// 3. Create PEs and add these into an object of PowerPeList. // 3. Create PEs and add these into an object of PowerPeList.
List<PowerPe> peList = new ArrayList<PowerPe>(); List<Pe> peList = new ArrayList<Pe>();
peList.add(new PowerPe(0, new PeProvisionerSimple(mips[i % mips.length]), new PowerModelLinear(maxPower, staticPowerPercent))); // need to store PowerPe id and MIPS Rating peList.add(new Pe(0, new PeProvisionerSimple(mips[i % mips.length]))); // need to store PowerPe id and MIPS Rating
// 4. Create PowerHost with its id and list of PEs and add them to the list of machines // 4. Create PowerHost with its id and list of PEs and add them to the list of machines
hostList.add( hostList.add(
...@@ -245,7 +245,8 @@ public class NonPowerAware { ...@@ -245,7 +245,8 @@ public class NonPowerAware {
new BwProvisionerSimple(bw), new BwProvisionerSimple(bw),
storage, storage,
peList, peList,
new VmSchedulerTimeShared(peList) new VmSchedulerTimeShared(peList),
new PowerModelLinear(maxPower, staticPowerPercent)
) )
); // This is our machine ); // This is our machine
} }
......
...@@ -21,6 +21,7 @@ import org.cloudbus.cloudsim.CloudletSchedulerDynamicWorkload; ...@@ -21,6 +21,7 @@ import org.cloudbus.cloudsim.CloudletSchedulerDynamicWorkload;
import org.cloudbus.cloudsim.DatacenterBroker; import org.cloudbus.cloudsim.DatacenterBroker;
import org.cloudbus.cloudsim.DatacenterCharacteristics; import org.cloudbus.cloudsim.DatacenterCharacteristics;
import org.cloudbus.cloudsim.Log; import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.Pe;
import org.cloudbus.cloudsim.Storage; import org.cloudbus.cloudsim.Storage;
import org.cloudbus.cloudsim.UtilizationModelStochastic; import org.cloudbus.cloudsim.UtilizationModelStochastic;
import org.cloudbus.cloudsim.Vm; import org.cloudbus.cloudsim.Vm;
...@@ -28,7 +29,6 @@ import org.cloudbus.cloudsim.VmSchedulerTimeShared; ...@@ -28,7 +29,6 @@ import org.cloudbus.cloudsim.VmSchedulerTimeShared;
import org.cloudbus.cloudsim.core.CloudSim; import org.cloudbus.cloudsim.core.CloudSim;
import org.cloudbus.cloudsim.power.PowerDatacenter; import org.cloudbus.cloudsim.power.PowerDatacenter;
import org.cloudbus.cloudsim.power.PowerHost; import org.cloudbus.cloudsim.power.PowerHost;
import org.cloudbus.cloudsim.power.PowerPe;
import org.cloudbus.cloudsim.power.PowerVmAllocationPolicySingleThreshold; import org.cloudbus.cloudsim.power.PowerVmAllocationPolicySingleThreshold;
import org.cloudbus.cloudsim.power.models.PowerModelLinear; import org.cloudbus.cloudsim.power.models.PowerModelLinear;
import org.cloudbus.cloudsim.provisioners.BwProvisionerSimple; import org.cloudbus.cloudsim.provisioners.BwProvisionerSimple;
...@@ -236,8 +236,8 @@ public class SingleThreshold { ...@@ -236,8 +236,8 @@ public class SingleThreshold {
// 2. A Machine contains one or more PEs or CPUs/Cores. // 2. A Machine contains one or more PEs or CPUs/Cores.
// In this example, it will have only one core. // In this example, it will have only one core.
// 3. Create PEs and add these into an object of PowerPeList. // 3. Create PEs and add these into an object of PowerPeList.
List<PowerPe> peList = new ArrayList<PowerPe>(); List<Pe> peList = new ArrayList<Pe>();
peList.add(new PowerPe(0, new PeProvisionerSimple(mips[i % mips.length]), new PowerModelLinear(maxPower, staticPowerPercent))); // need to store PowerPe id and MIPS Rating peList.add(new Pe(0, new PeProvisionerSimple(mips[i % mips.length]))); // need to store PowerPe id and MIPS Rating
// 4. Create PowerHost with its id and list of PEs and add them to the list of machines // 4. Create PowerHost with its id and list of PEs and add them to the list of machines
hostList.add( hostList.add(
...@@ -247,7 +247,8 @@ public class SingleThreshold { ...@@ -247,7 +247,8 @@ public class SingleThreshold {
new BwProvisionerSimple(bw), new BwProvisionerSimple(bw),
storage, storage,
peList, peList,
new VmSchedulerTimeShared(peList) new VmSchedulerTimeShared(peList),
new PowerModelLinear(maxPower, staticPowerPercent)
) )
); // This is our machine ); // This is our machine
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment