/** * Verifies if some cloudlet inside this Datacenter already finished. * If yes, send it to the User/Broker * * @pre $none * @post $none */ protected void checkCloudletCompletion() { List<? extends Host> list = getVmAllocationPolicy().getHostList(); for (int i = 0; i < list.size(); i++) { Host host = list.get(i); for (Vm vm : host.getVmList()) { while (vm.getCloudletScheduler().isFinishedCloudlets()) { Cloudlet cl = vm.getCloudletScheduler().getNextFinishedCloudlet(); if (cl != null) { sendNow(cl.getUserId(), CloudSimTags.CLOUDLET_RETURN, cl); } } } } }