cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus-examples/src/main/java/org/cloudsimplus/examples/migration/MigrationExample1.java
private UtilizationModelDynamic createCpuUtilizationModel(double initialCpuUsagePercent, double maxCpuUsagePercentage) {
        if(maxCpuUsagePercentage < initialCpuUsagePercent){
            throw new IllegalArgumentException("Max CPU usage must be equal or greater than the initial CPU usage.");
        }

        initialCpuUsagePercent = Math.min(initialCpuUsagePercent, 1);
        maxCpuUsagePercentage = Math.min(maxCpuUsagePercentage, 1);
        UtilizationModelDynamic um;
        if (initialCpuUsagePercent < maxCpuUsagePercentage) {
            um = new UtilizationModelDynamic(initialCpuUsagePercent)
                        .setUtilizationUpdateFunction(this::getCpuUsageIncrement);
        } else {
            um = new UtilizationModelDynamic(initialCpuUsagePercent);
        }

        um.setMaxResourceUtilization(maxCpuUsagePercentage);
        return um;
    }
/**
     * Creates a CPU UtilizationModel for a Cloudlet.
     * If the initial usage is lower than the max usage, the usage will
     * be dynamically incremented along the time, according to the
     * {@link #getCpuUsageIncrement(org.cloudbus.cloudsim.utilizationmodels.UtilizationModelDynamic)}
     * function. Otherwise, the CPU usage will be static, according to the
     * defined initial usage.
     *
     * @param initialCpuUsagePercent the percentage of CPU utilization
     * that created Cloudlets will use when they start to execute.
     * If this value is greater than 1 (100%), it will be changed to 1.
     * @param maxCpuUsagePercentage the maximum percentage of
     * CPU utilization that created Cloudlets are allowed to use.
     * If this value is greater than 1 (100%), it will be changed to 1.
     * It must be equal or greater than the initial CPU usage.
     * @return
     */
Creates a CPU UtilizationModel for a Cloudlet.
If the initial usage is lower than the max usage, the usage will
be dynamically incremented along the time, according to the
#getCpuUsageIncrement(org.cloudbus.cloudsim.utilizationmodels.UtilizationModelDynamic)
function. Otherwise, the CPU usage will be static, according to the
defined initial usage.

@param initialCpuUsagePercent the percentage of CPU utilization
that created Cloudlets will use when they start to execute.
If this value is greater than 1 (100%), it will be changed to 1.
@param maxCpuUsagePercentage the maximum percentage of
CPU utilization that created Cloudlets are allowed to use.
If this value is greater than 1 (100%), it will be changed to 1.
It must be equal or greater than the initial CPU usage.
@return
Creates a CPU UtilizationModel for a Cloudlet . If the initial usage is lower than the max usage the usage will be dynamically incremented along the time according to the #getCpuUsageIncrement ( org . cloudbus . cloudsim . utilizationmodels . UtilizationModelDynamic ) function . Otherwise the CPU usage will be static according to the defined initial usage . @param initialCpuUsagePercent the percentage of CPU utilization that created Cloudlets will use when they start to execute . If this value is greater than 1 ( 100% ) it will be changed to 1 . @param maxCpuUsagePercentage the maximum percentage of CPU utilization that created Cloudlets are allowed to use . If this value is greater than 1 ( 100% ) it will be changed to 1 . It must be equal or greater than the initial CPU usage . @return
private UtilizationModelDynamic createCpuUtilizationModel(double initialCpuUsagePercent, double maxCpuUsagePercentage) {
        if(maxCpuUsagePercentage < initialCpuUsagePercent){
            throw new IllegalArgumentException("Max CPU usage must be equal or greater than the initial CPU usage.");
        }
        initialCpuUsagePercent = Math.min(initialCpuUsagePercent, 1);
        maxCpuUsagePercentage = Math.min(maxCpuUsagePercentage, 1);
        UtilizationModelDynamic um;
        if (initialCpuUsagePercent < maxCpuUsagePercentage) {
            um = new UtilizationModelDynamic(initialCpuUsagePercent)
                        .setUtilizationUpdateFunction(this::getCpuUsageIncrement);
        } else {
            um = new UtilizationModelDynamic(initialCpuUsagePercent);
        }
        um.setMaxResourceUtilization(maxCpuUsagePercentage);
        return um;
    }
private UtilizationModelDynamic createCpuUtilizationModel ( double initialCpuUsagePercent , double maxCpuUsagePercentage ) { if ( maxCpuUsagePercentage < initialCpuUsagePercent ) { throw new IllegalArgumentException ( "Max CPU usage must be equal or greater than the initial CPU usage." ) ; } initialCpuUsagePercent = Math . min ( initialCpuUsagePercent , 1 ) ; maxCpuUsagePercentage = Math . min ( maxCpuUsagePercentage , 1 ) ; UtilizationModelDynamic um ; if ( initialCpuUsagePercent < maxCpuUsagePercentage ) { um = new UtilizationModelDynamic ( initialCpuUsagePercent ) . setUtilizationUpdateFunction ( this :: getCpuUsageIncrement ) ; } else { um = new UtilizationModelDynamic ( initialCpuUsagePercent ) ; } um . setMaxResourceUtilization ( maxCpuUsagePercentage ) ; return um ; }
Creates a CPU UtilizationModel for a Cloudlet.
Creates a CPU UtilizationModel for a Cloudlet .