Commit 89d68c3f authored by Anton Beloglazov's avatar Anton Beloglazov

- Fixed a bug when completed cloudlets have not been received by the broker in the Power package.

parent ba84d6c2
......@@ -97,7 +97,6 @@ public class PowerDatacenter extends Datacenter {
Log.printLine("\n");
for (PowerHost host : this.<PowerHost>getHostList()) {
Log.formatLine("%.2f: Host #%d", CloudSim.clock(), host.getId());
double hostPower = 0.0;
......@@ -132,6 +131,8 @@ public class PowerDatacenter extends Datacenter {
setPower(getPower() + timeframePower);
checkCloudletCompletion();
/** Remove completed VMs **/
for (PowerHost host : this.<PowerHost>getHostList()) {
for (Vm vm : host.getCompletedVms()) {
......
......@@ -105,6 +105,8 @@ public class PowerDatacenterNonPowerAware extends PowerDatacenter {
setPower(getPower() + timeframePower);
checkCloudletCompletion();
/** Remove completed VMs **/
for (PowerHost host : this.<PowerHost>getHostList()) {
for (Vm vm : host.getCompletedVms()) {
......@@ -143,7 +145,8 @@ public class PowerDatacenterNonPowerAware extends PowerDatacenter {
// schedules an event to the next time
if (minTime != Double.MAX_VALUE) {
CloudSim.cancelAll(getId(), CloudSim.SIM_ANY);
CloudSim.cancelAll(getId(), new PredicateType(CloudSimTags.VM_DATACENTER_EVENT));
//CloudSim.cancelAll(getId(), CloudSim.SIM_ANY);
send(getId(), getSchedulingInterval(), CloudSimTags.VM_DATACENTER_EVENT);
}
......
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