@Override public List<ResourceManageable> getResources() { if(getSimulation().isRunning() && resources.isEmpty()){ resources = Arrays.asList(ram, bw, storage, processor); } return Collections.unmodifiableList(resources); }
@Override public double getIdleInterval() { return getSimulation().clock() - lastBusyTime; }
@Override public double getTotalExecutionTime() { if(startTime < 0) { return 0; } return stopTime < 0 ? getSimulation().clock() - startTime : stopTime - startTime; }
@Override public double getTotalCpuMipsUsage() { return getTotalCpuMipsUsage(getSimulation().clock()); }
@Override public double getCpuPercentUsage() { return getCpuPercentUsage(getSimulation().clock()); }
@Override public double updateProcessing(final double currentTime, final List<Double> mipsShare) { requireNonNull(mipsShare); if(!cloudletScheduler.getCloudletExecList().isEmpty()){ this.lastBusyTime = getSimulation().clock(); } final double nextEventDelay = cloudletScheduler.updateProcessing(currentTime, mipsShare); notifyOnUpdateProcessingListeners(); /* If the current time is some value with the decimals greater than x.0 * (such as 45.1) and the next event delay is any integer number such as 5, * then the next simulation time will be 50.1. * At time 50.1 the utilization will be reduced due to the completion of the Cloudlet. * At time 50.0 the Cloudlet is still running, so there is some CPU utilization. * But since the next update will be only at time 50.1, the utilization * at time 50.0 won't be collected to enable knowing the exact time * before the utilization dropped. */ final double decimals = currentTime - (int) currentTime; utilizationHistory.addUtilizationHistory(currentTime); return nextEventDelay - decimals; }