Commit e5a09a88 authored by Anton Beloglazov's avatar Anton Beloglazov

- Removed some obsolete code

parent 3e2b37f5
...@@ -193,20 +193,6 @@ public abstract class CloudletScheduler { ...@@ -193,20 +193,6 @@ public abstract class CloudletScheduler {
*/ */
public abstract List<Double> getCurrentRequestedMips(); public abstract List<Double> getCurrentRequestedMips();
// /**
// * Gets the current allocated mips.
// *
// * @return the current allocated mips
// */
// public abstract List<Double> getCurrentAllocatedMips();
//
// /**
// * Gets the total current allocated mips.
// *
// * @return the total current allocated mips
// */
// public abstract double getTotalCurrentAllocatedMips();
/** /**
* Gets the total current mips for the Cloudlet. * Gets the total current mips for the Cloudlet.
* *
......
...@@ -255,40 +255,6 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare ...@@ -255,40 +255,6 @@ public class CloudletSchedulerDynamicWorkload extends CloudletSchedulerTimeShare
return totalCurrentRequestedMips; return totalCurrentRequestedMips;
} }
// /* (non-Javadoc)
// * @see cloudsim.CloudletScheduler#getTotalCurrentAllocatedMips()
// */
// @Override
// public double getTotalCurrentAllocatedMips() {
// double totalAllocatedMips = 0;
// for (ResCloudlet rcl : getCloudletExecList()) {
// totalAllocatedMips += getTotalCurrentAllocatedMipsForCloudlet(rcl, getPreviousTime());
// }
// return totalAllocatedMips;
//
// }
//
// /* (non-Javadoc)
// * @see cloudsim.CloudletSchedulerTimeShared#getCurrentAllocatedMips()
// */
// @Override
// public List<Double> getCurrentAllocatedMips() {
// double totalAllocatedMips = getTotalCurrentAllocatedMips();
// List<Double> allocatedMips = new ArrayList<Double>();
// for (Double mips : getCurrentMipsShare()) {
// if (totalAllocatedMips == 0) {
// allocatedMips.add(0.0);
// } else if (totalAllocatedMips > mips) {
// allocatedMips.add(mips);
// totalAllocatedMips -= mips;
// } else {
// allocatedMips.add(totalAllocatedMips);
// totalAllocatedMips = 0;
// }
// }
// return allocatedMips;
// }
/** /**
* Update under allocated mips for cloudlet. * Update under allocated mips for cloudlet.
* *
......
...@@ -84,19 +84,6 @@ public abstract class VmAllocationPolicy { ...@@ -84,19 +84,6 @@ public abstract class VmAllocationPolicy {
*/ */
public abstract void deallocateHostForVm(Vm vm); public abstract void deallocateHostForVm(Vm vm);
/**
* Trigger a migration from a given virtual machine to a selected
* host.
*
* @param vm the vm
*
* @return $true if the migration succeeds; $false otherwise
*
* @pre $none
* @post $none
*/
//public abstract boolean migrateVm(Vm vm, Host destination);
/** /**
* Get the host that is executing the given VM belonging to the * Get the host that is executing the given VM belonging to the
* given user. * given user.
......
...@@ -170,12 +170,8 @@ public class PowerDatacenter extends Datacenter { ...@@ -170,12 +170,8 @@ public class PowerDatacenter extends Datacenter {
// schedules an event to the next time // schedules an event to the next time
if (minTime != Double.MAX_VALUE) { if (minTime != Double.MAX_VALUE) {
// if (minTime > currentTime + 0.01 && minTime < getSchedulingInterval()) {
// send(getId(), minTime - currentTime, CloudSimTags.VM_DATACENTER_EVENT);
// } else {
CloudSim.cancelAll(getId(), new PredicateType(CloudSimTags.VM_DATACENTER_EVENT)); CloudSim.cancelAll(getId(), new PredicateType(CloudSimTags.VM_DATACENTER_EVENT));
send(getId(), getSchedulingInterval(), CloudSimTags.VM_DATACENTER_EVENT); send(getId(), getSchedulingInterval(), CloudSimTags.VM_DATACENTER_EVENT);
// }
} }
setLastProcessTime(currentTime); setLastProcessTime(currentTime);
......
...@@ -60,11 +60,6 @@ public class PowerDatacenterNonPowerAware extends PowerDatacenter { ...@@ -60,11 +60,6 @@ public class PowerDatacenterNonPowerAware extends PowerDatacenter {
*/ */
@Override @Override
protected void updateCloudletProcessing() { protected void updateCloudletProcessing() {
// if (isInMigration()) {
// CloudSim.cancelAll(getId(), new PredicateType(CloudSimTags.VM_DATACENTER_EVENT));
// schedule(getId(), getSchedulingInterval(), CloudSimTags.VM_DATACENTER_EVENT);
// return;
// }
if (getCloudletSubmitted() == -1 || getCloudletSubmitted() == CloudSim.clock()) { if (getCloudletSubmitted() == -1 || getCloudletSubmitted() == CloudSim.clock()) {
CloudSim.cancelAll(getId(), new PredicateType(CloudSimTags.VM_DATACENTER_EVENT)); CloudSim.cancelAll(getId(), new PredicateType(CloudSimTags.VM_DATACENTER_EVENT));
schedule(getId(), getSchedulingInterval(), CloudSimTags.VM_DATACENTER_EVENT); schedule(getId(), getSchedulingInterval(), CloudSimTags.VM_DATACENTER_EVENT);
...@@ -85,7 +80,6 @@ public class PowerDatacenterNonPowerAware extends PowerDatacenter { ...@@ -85,7 +80,6 @@ public class PowerDatacenterNonPowerAware extends PowerDatacenter {
double hostPower = 0.0; double hostPower = 0.0;
try { try {
//hostPower = host.getPower() * timeDiff;
hostPower = host.getMaxPower() * timeDiff; hostPower = host.getMaxPower() * timeDiff;
timeframePower += hostPower; timeframePower += hostPower;
} catch (Exception e) { } catch (Exception e) {
...@@ -143,18 +137,14 @@ public class PowerDatacenterNonPowerAware extends PowerDatacenter { ...@@ -143,18 +137,14 @@ public class PowerDatacenterNonPowerAware extends PowerDatacenter {
vm.setInMigration(true); vm.setInMigration(true);
/** VM migration delay = RAM / bandwidth + C (C = 10 sec) **/ /** VM migration delay = RAM / bandwidth + C (C = 10 sec) **/
send(getId(), (double) vm.getRam() / (vm.getBw() / 8000) + 10, CloudSimTags.VM_MIGRATE, migrate); send(getId(), vm.getRam() / ((double) vm.getBw() / 8000) + 10, CloudSimTags.VM_MIGRATE, migrate);
} }
} }
// schedules an event to the next time // schedules an event to the next time
if (minTime != Double.MAX_VALUE) { if (minTime != Double.MAX_VALUE) {
// if (minTime > currentTime + 0.01 && minTime < getSchedulingInterval()) {
// send(getId(), minTime - currentTime, CloudSimTags.VM_DATACENTER_EVENT);
// } else {
CloudSim.cancelAll(getId(), CloudSim.SIM_ANY); CloudSim.cancelAll(getId(), CloudSim.SIM_ANY);
send(getId(), getSchedulingInterval(), CloudSimTags.VM_DATACENTER_EVENT); send(getId(), getSchedulingInterval(), CloudSimTags.VM_DATACENTER_EVENT);
// }
} }
setLastProcessTime(currentTime); setLastProcessTime(currentTime);
......
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