@Override public double getTotalCurrentAvailableMipsForCloudlet(ResCloudlet rcl, List<Double> mipsShare) { /*@todo It isn't being used any the the given parameters.*/ return getCapacity(getCurrentMipsShare()); }
@Override public double cloudletSubmit(Cloudlet cloudlet, double fileTransferTime) { ResCloudlet rcl = new ResCloudlet(cloudlet); rcl.setCloudletStatus(Cloudlet.INEXEC); for (int i = 0; i < cloudlet.getNumberOfPes(); i++) { rcl.setMachineAndPeId(0, i); } getCloudletExecList().add(rcl); // use the current capacity to estimate the extra amount of // time to file transferring. It must be added to the cloudlet length double extraSize = getCapacity(getCurrentMipsShare()) * fileTransferTime; long length = (long) (cloudlet.getCloudletLength() + extraSize); cloudlet.setCloudletLength(length); return cloudlet.getCloudletLength() / getCapacity(getCurrentMipsShare()); }
@Override public double cloudletResume(int cloudletId) { boolean found = false; int position = 0; // look for the cloudlet in the paused list for (ResCloudlet rcl : getCloudletPausedList()) { if (rcl.getCloudletId() == cloudletId) { found = true; break; } position++; } if (found) { ResCloudlet rgl = getCloudletPausedList().remove(position); rgl.setCloudletStatus(Cloudlet.INEXEC); getCloudletExecList().add(rgl); // calculate the expected time for cloudlet completion // first: how many PEs do we have? double remainingLength = rgl.getRemainingCloudletLength(); double estimatedFinishTime = CloudSim.clock() + (remainingLength / (getCapacity(getCurrentMipsShare()) * rgl.getNumberOfPes())); return estimatedFinishTime; } return 0.0; }
rcl.updateCloudletFinishedSoFar((long) (getCapacity(mipsShare) * timeSpam * rcl.getNumberOfPes() * Consts.MILLION)); + (rcl.getRemainingCloudletLength() / (getCapacity(mipsShare) * rcl.getNumberOfPes())); if (estimatedFinishTime - currentTime < CloudSim.getMinTimeBetweenEvents()) { estimatedFinishTime = currentTime + CloudSim.getMinTimeBetweenEvents();