Commit f7f3f15a authored by Anton Beloglazov's avatar Anton Beloglazov

- Small fix

parent 2a72d522
...@@ -93,7 +93,7 @@ public class Datacenter extends SimEntity { ...@@ -93,7 +93,7 @@ public class Datacenter extends SimEntity {
setStorageList(storageList); setStorageList(storageList);
setVmList(new ArrayList<Vm>()); setVmList(new ArrayList<Vm>());
setSchedulingInterval(schedulingInterval); setSchedulingInterval(schedulingInterval);
for (Host host: getCharacteristics().getHostList()) { for (Host host: getCharacteristics().getHostList()) {
host.setDatacenter(this); host.setDatacenter(this);
} }
...@@ -542,7 +542,7 @@ public class Datacenter extends SimEntity { ...@@ -542,7 +542,7 @@ public class Datacenter extends SimEntity {
boolean result = getVmAllocationPolicy().allocateHostForVm(vm, host); boolean result = getVmAllocationPolicy().allocateHostForVm(vm, host);
if (!result) { if (!result) {
Log.printLine("[Datacenter.processVmMigrate] VM allocation to the destination host failed"); Log.printLine("[Datacenter.processVmMigrate] VM allocation to the destination host failed");
System.exit(0); System.exit(0);
} }
if (ack) { if (ack) {
...@@ -765,7 +765,7 @@ public class Datacenter extends SimEntity { ...@@ -765,7 +765,7 @@ public class Datacenter extends SimEntity {
double estimatedFinishTime = scheduler.cloudletSubmit(cl,fileTransferTime); double estimatedFinishTime = scheduler.cloudletSubmit(cl,fileTransferTime);
//if (estimatedFinishTime > 0.0 && estimatedFinishTime < getSchedulingInterval()) { //if this cloudlet is in the exec queue //if (estimatedFinishTime > 0.0 && estimatedFinishTime < getSchedulingInterval()) { //if this cloudlet is in the exec queue
if (estimatedFinishTime > 0.0) { //if this cloudlet is in the exec queue if (estimatedFinishTime > 0.0 && !Double.isInfinite(estimatedFinishTime)) { //if this cloudlet is in the exec queue
//double estimatedFinishTime = (cl.getCloudletTotalLength()/(capacity*cl.getPesNumber())); //time to process the cloudlet //double estimatedFinishTime = (cl.getCloudletTotalLength()/(capacity*cl.getPesNumber())); //time to process the cloudlet
//Log.printLine(estimatedFinishTime+"="+gl.getCloudletLength()+"/("+capacity+"*"+gl.getNumPE()+")"); //Log.printLine(estimatedFinishTime+"="+gl.getCloudletLength()+"/("+capacity+"*"+gl.getNumPE()+")");
estimatedFinishTime += fileTransferTime; estimatedFinishTime += fileTransferTime;
...@@ -773,7 +773,7 @@ public class Datacenter extends SimEntity { ...@@ -773,7 +773,7 @@ public class Datacenter extends SimEntity {
//Log.printLine(CloudSim.clock()+": Next event scheduled to +"+estimatedFinishTime); //Log.printLine(CloudSim.clock()+": Next event scheduled to +"+estimatedFinishTime);
send(getId(), estimatedFinishTime, CloudSimTags.VM_DATACENTER_EVENT); send(getId(), estimatedFinishTime, CloudSimTags.VM_DATACENTER_EVENT);
} }
if (ack) { if (ack) {
int[] data = new int[3]; int[] data = new int[3];
data[0] = getId(); data[0] = getId();
...@@ -924,7 +924,9 @@ public class Datacenter extends SimEntity { ...@@ -924,7 +924,9 @@ public class Datacenter extends SimEntity {
} }
} }
//gurantees a minimal interval before scheduling the event //gurantees a minimal interval before scheduling the event
if (smallerTime<CloudSim.clock()+0.1) smallerTime=CloudSim.clock()+0.1; if (smallerTime<CloudSim.clock()+0.1) {
smallerTime=CloudSim.clock()+0.1;
}
if (smallerTime != Double.MAX_VALUE) { if (smallerTime != Double.MAX_VALUE) {
schedule(getId(), (smallerTime - CloudSim.clock()), CloudSimTags.VM_DATACENTER_EVENT); schedule(getId(), (smallerTime - CloudSim.clock()), 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