cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudbus/cloudsim/allocationpolicies/power/PowerVmAllocationPolicyMigrationLocalRegression.java
@Override
    public double computeHostUtilizationMeasure(PowerHostUtilizationHistory host) throws IllegalArgumentException{
        double[] utilizationHistory = host.getUtilizationHistory();
        final int length = 10; // we use 10 to make the regression responsive enough to latest values
        if (utilizationHistory.length < length) {
            throw new IllegalArgumentException("There is not enough Host history to estimate its utilization using Local Regression");
        }

        double[] utilizationHistoryReversed = new double[length];
        for (int i = 0; i < length; i++) {
            utilizationHistoryReversed[i] = utilizationHistory[length - i - 1];
        }
        double[] estimates = getParameterEstimates(utilizationHistoryReversed);
        double migrationIntervals = Math.ceil(getMaximumVmMigrationTime(host) / getSchedulingInterval());
        return estimates[0] + estimates[1] * (length + migrationIntervals);
    }
/**
     * Computes a Local Regression of the host utilization history to <b>estimate</b> the current host utilization.
     * Such a value is used to generate the host over utilization threshold.
     *
     * @param host the host
     * @return the host utilization Local Regression
     * @throws {@inheritDoc}
     */
Computes a Local Regression of the host utilization history to estimate the current host utilization.
Such a value is used to generate the host over utilization threshold.

@param host the host
@return the host utilization Local Regression
@throws
Computes a Local Regression of the host utilization history to estimate the current host utilization . Such a value is used to generate the host over utilization threshold . @param host the host @return the host utilization Local Regression @throws
@Override
    public double computeHostUtilizationMeasure(PowerHostUtilizationHistory host) throws IllegalArgumentException{
        double[] utilizationHistory = host.getUtilizationHistory();
        final int length = 10; 
        if (utilizationHistory.length < length) {
            throw new IllegalArgumentException("There is not enough Host history to estimate its utilization using Local Regression");
        }
        double[] utilizationHistoryReversed = new double[length];
        for (int i = 0; i < length; i++) {
            utilizationHistoryReversed[i] = utilizationHistory[length - i - 1];
        }
        double[] estimates = getParameterEstimates(utilizationHistoryReversed);
        double migrationIntervals = Math.ceil(getMaximumVmMigrationTime(host) / getSchedulingInterval());
        return estimates[0] + estimates[1] * (length + migrationIntervals);
    }
@ Override public double computeHostUtilizationMeasure ( PowerHostUtilizationHistory host ) throws IllegalArgumentException { double [ ] utilizationHistory = host . getUtilizationHistory ( ) ; final int length = 10 ; if ( utilizationHistory . length < length ) { throw new IllegalArgumentException ( "There is not enough Host history to estimate its utilization using Local Regression" ) ; } double [ ] utilizationHistoryReversed = new double [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { utilizationHistoryReversed [ i ] = utilizationHistory [ length - i - 1 ] ; } double [ ] estimates = getParameterEstimates ( utilizationHistoryReversed ) ; double migrationIntervals = Math . ceil ( getMaximumVmMigrationTime ( host ) / getSchedulingInterval ( ) ) ; return estimates [ 0 ] + estimates [ 1 ] * ( length + migrationIntervals ) ; }
Computes a Local Regression of the host utilization history to <b>estimate</b> the current host utilization.
Computes a Local Regression of the host utilization history to <b > estimate< / b > the current host utilization .
// we use 10 to make the regression responsive enough to latest values