Buggy code:
public class CloudletSchedulerTimeShared extends CloudletScheduler { private List < ? extends ResCloudlet > cloudletExecList ; private List < ? extends ResCloudlet > cloudletPausedList ; private List < ? extends ResCloudlet > cloudletFinishedList ; protected int currentCPUs ; public CloudletSchedulerTimeShared ( ) { } @ Override public double updateVmProcessing ( double currentTime , List < Double > mipsShare ) { setCurrentMipsShare ( mipsShare ) ; double timeSpam = currentTime - ( getPreviousTime ( ) ) ; for ( ResCloudlet rcl : getCloudletExecList ( ) ) { <START_BUG> rcl . updateCloudletFinishedSoFar ( ( ( long ) ( Math . ceil ( ( ( ( getCapacity ( mipsShare ) ) * timeSpam ) * ( rcl . getPesNumber ( ) ) ) ) ) ) ) ; <END_BUG> } if ( ( getCloudletExecList ( ) . size ( ) ) == 0 ) { setPreviousTime ( currentTime ) ; return 0.0 ; } double nextEvent = Double . MAX_VALUE ; int i = 0 ; List < ResCloudlet > toRemove = new ArrayList < ResCloudlet > ( ) ; for ( ResCloudlet rcl : getCloudletExecList ( ) ) { long remainingLength = rcl . getRemainingCloudletLength ( ) ; if ( remainingLength == 0 ) { toRemove . add ( rcl ) ; cloudletFinish ( rcl ) ; continue ; } i ++ ; } getCloudletExecList ( ) . removeAll ( toRemove ) ; i = 0 ; for ( ResCloudlet rcl : getCloudletExecList ( ) ) { double estimatedFinishTime = currentTime + ( ( rcl . getRemainingCloudletLength ( ) ) // ( ( getCapacity ( mipsShare ) ) * ( rcl . getPesNumber ( ) ) ) ) ; if ( ( estimatedFinishTime - currentTime ) < 0.1 ) { estimatedFinishTime = currentTime + 0.1 ; } if ( estimatedFinishTime < nextEvent ) { nextEvent = estimatedFinishTime ; } i ++ ; } setPreviousTime ( currentTime ) ; return nextEvent ; } private double getCapacity ( List < Double > mipsShare ) { } @ Override public Cloudlet cloudletCancel ( int cloudletId ) { } @ Override public boolean cloudletPause ( int cloudletId ) { } @ Override public void cloudletFinish ( ResCloudlet rcl ) { } @ Override public double cloudletResume ( int cloudletId ) { } @ Override public double cloudletSubmit ( Cloudlet cloudlet , double fileTransferTime ) { } @ Override public double cloudletSubmit ( Cloudlet cloudlet ) { } @ Override public int getCloudletStatus ( int cloudletId ) { } @ Override public double getTotalUtilizationOfCpu ( double time ) { } @ Override public boolean isFinishedCloudlets ( ) { } @ Override public Cloudlet getNextFinishedCloudlet ( ) { } @ Override public int runningCloudlets ( ) { } @ Override public Cloudlet migrateCloudlet ( ) { } @ SuppressWarnings ( "unchecked" ) protected < T extends ResCloudlet > List < T > getCloudletExecList ( ) { } protected < T extends ResCloudlet > void setCloudletExecList ( List < T > cloudletExecList ) { } @ SuppressWarnings ( "unchecked" ) protected < T extends ResCloudlet > List < T > getCloudletPausedList ( ) { } protected < T extends ResCloudlet > void setCloudletPausedList ( List < T > cloudletPausedList ) { } @ SuppressWarnings ( "unchecked" ) protected < T extends ResCloudlet > List < T > getCloudletFinishedList ( ) { } protected < T extends ResCloudlet > void setCloudletFinishedList ( List < T > cloudletFinishedList ) { } @ Override public List < Double > getCurrentRequestedMips ( ) { } @ Override public double getTotalCurrentAvailableMipsForCloudlet ( ResCloudlet rcl , List < Double > mipsShare ) { } @ Override public double getTotalCurrentAllocatedMipsForCloudlet ( ResCloudlet rcl , double time ) { } @ Override public double getTotalCurrentRequestedMipsForCloudlet ( ResCloudlet rcl , double time ) { } @ Override public double getCurrentRequestedUtilizationOfRam ( ) { } @ Override public double getCurrentRequestedUtilizationOfBw ( ) { } }

Fix:
rcl . updateCloudletFinishedSoFar ( ( ( long ) ( ( ( ( getCapacity ( mipsShare ) ) * timeSpam ) * ( rcl . getPesNumber ( ) ) ) * 1000000 ) ) ) ;