cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudbus/cloudsim/allocationpolicies/VmAllocationPolicyAbstract.java
private boolean scaleVmPesUpOrDown(VerticalVmScaling scaling) {
        final double numberOfPesForScaling = scaling.getResourceAmountToScale();
        if(numberOfPesForScaling == 0){
            return false;
        }

        final Vm vm = scaling.getVm();
        if (scaling.isVmOverloaded() && isNotHostPesSuitableToUpScaleVm(scaling)) {
            showResourceIsUnavailable(scaling);
            return false;
        }

        vm.getHost().getVmScheduler().deallocatePesFromVm(vm);
        if(scaling.isVmUnderloaded()) {
            vm.getProcessor().removeCapacity((long)numberOfPesForScaling);
        }
        else {
            vm.getProcessor().addCapacity((long)numberOfPesForScaling);
        }

        vm.getHost().getVmScheduler().allocatePesForVm(vm);
        return true;
    }
/**
     * Performs the up or down scaling of Vm {@link Pe}s,
     * depending if the VM is under or overloaded.
     *
     * @param scaling the Vm's scaling object
     * @return true if the scaling was performed, false otherwise
     * @see #upScaleVmVertically(VerticalVmScaling)
     */
Performs the up or down scaling of Vm  Pes,
depending if the VM is under or overloaded.

@param scaling the Vm's scaling object
@return true if the scaling was performed, false otherwise
@see #upScaleVmVertically(VerticalVmScaling)
Performs the up or down scaling of Vm Pes depending if the VM is under or overloaded . @param scaling the Vm ' s scaling object @return true if the scaling was performed false otherwise @see #upScaleVmVertically ( VerticalVmScaling )
private boolean scaleVmPesUpOrDown(VerticalVmScaling scaling) {
        final double numberOfPesForScaling = scaling.getResourceAmountToScale();
        if(numberOfPesForScaling == 0){
            return false;
        }
        final Vm vm = scaling.getVm();
        if (scaling.isVmOverloaded() && isNotHostPesSuitableToUpScaleVm(scaling)) {
            showResourceIsUnavailable(scaling);
            return false;
        }
        vm.getHost().getVmScheduler().deallocatePesFromVm(vm);
        if(scaling.isVmUnderloaded()) {
            vm.getProcessor().removeCapacity((long)numberOfPesForScaling);
        }
        else {
            vm.getProcessor().addCapacity((long)numberOfPesForScaling);
        }
        vm.getHost().getVmScheduler().allocatePesForVm(vm);
        return true;
    }
private boolean scaleVmPesUpOrDown ( VerticalVmScaling scaling ) { final double numberOfPesForScaling = scaling . getResourceAmountToScale ( ) ; if ( numberOfPesForScaling == 0 ) { return false ; } final Vm vm = scaling . getVm ( ) ; if ( scaling . isVmOverloaded ( ) && isNotHostPesSuitableToUpScaleVm ( scaling ) ) { showResourceIsUnavailable ( scaling ) ; return false ; } vm . getHost ( ) . getVmScheduler ( ) . deallocatePesFromVm ( vm ) ; if ( scaling . isVmUnderloaded ( ) ) { vm . getProcessor ( ) . removeCapacity ( ( long ) numberOfPesForScaling ) ; } else { vm . getProcessor ( ) . addCapacity ( ( long ) numberOfPesForScaling ) ; } vm . getHost ( ) . getVmScheduler ( ) . allocatePesForVm ( vm ) ; return true ; }
Performs the up or down scaling of Vm {@link Pe}s,
 depending if the VM is under or overloaded.
Performs the up or down scaling of Vm { @link Pe } s depending if the VM is under or overloaded .