@Override public int runningCloudlets() { return getCloudletExecList().size(); }
@Override public double getTotalUtilizationOfCpu(double time) { double totalUtilization = 0; for (ResCloudlet gl : getCloudletExecList()) { totalUtilization += gl.getCloudlet().getUtilizationOfCpu(time); } return totalUtilization; }
/** * Returns the first cloudlet to migrate to another VM. * * @return the first running cloudlet * @pre $none * @post $none * * @todo it doesn't check if the list is empty */ @Override public Cloudlet migrateCloudlet() { ResCloudlet rcl = getCloudletExecList().remove(0); rcl.finalizeCloudlet(); Cloudlet cl = rcl.getCloudlet(); usedPes -= cl.getNumberOfPes(); return cl; }
for (ResCloudlet rcl : getCloudletExecList()) { rcl.updateCloudletFinishedSoFar( (long) (capacity * timeSpam * rcl.getNumberOfPes() * Consts.MILLION)); if (getCloudletExecList().size() == 0 && getCloudletWaitingList().size() == 0) { setPreviousTime(currentTime); return 0.0; for (ResCloudlet rcl : getCloudletExecList()) { getCloudletExecList().removeAll(toRemove); rcl.setMachineAndPeId(0, i); getCloudletExecList().add(rcl); usedPes += rcl.getNumberOfPes(); toRemove.add(rcl); for (ResCloudlet rcl : getCloudletExecList()) { double remainingLength = rcl.getRemainingCloudletLength(); double estimatedFinishTime = currentTime + (remainingLength / (capacity * rcl.getNumberOfPes()));
for (ResCloudlet rcl : getCloudletExecList()) { if (rcl.getCloudletId() == cloudletId) { found = true; ResCloudlet rgl = getCloudletExecList().remove(position); if (rgl.getRemainingCloudletLength() == 0) { cloudletFinish(rgl);
for (ResCloudlet rcl : getCloudletExecList()) { if (rcl.getCloudletId() == cloudletId) { getCloudletExecList().remove(rcl); if (rcl.getRemainingCloudletLength() == 0) { cloudletFinish(rcl);
@Override public int getCloudletStatus(int cloudletId) { for (ResCloudlet rcl : getCloudletExecList()) { if (rcl.getCloudletId() == cloudletId) { return rcl.getCloudletStatus(); } } for (ResCloudlet rcl : getCloudletPausedList()) { if (rcl.getCloudletId() == cloudletId) { return rcl.getCloudletStatus(); } } for (ResCloudlet rcl : getCloudletWaitingList()) { if (rcl.getCloudletId() == cloudletId) { return rcl.getCloudletStatus(); } } return -1; }
rcl.setMachineAndPeId(0, i); getCloudletExecList().add(rcl); usedPes += cloudlet.getNumberOfPes(); } else {// no enough free PEs: go to the waiting queue
rcl.getCloudlet().setCloudletLength(size); getCloudletExecList().add(rcl); usedPes += rcl.getNumberOfPes();