static public double hybrid_composition(double[] x, HCJob job) throws JMetalException {

    int num_func = job.numberOfBasicFunctions;
    int num_dim = job.numberOfDimensions;

    // Get the raw weights
    double wMax = Double.NEGATIVE_INFINITY;
    for (int i = 0; i < num_func; i++) {
      double sumSqr = 0.0;
      shift(job.z[i], x, job.shiftGlobalOptimum[i]);
      for (int j = 0; j < num_dim; j++) {
        sumSqr += (job.z[i][j] * job.z[i][j]);
      }
      job.w[i] = Math.exp(-1.0 * sumSqr / (2.0 * num_dim * job.sigma[i] * job.sigma[i]));
      if (wMax < job.w[i]) {
        wMax = job.w[i];
      }
    }

    // Modify the weights
    double wSum = 0.0;
    double w1mMaxPow = 1.0 - Math.pow(wMax, 10.0);
    for (int i = 0; i < num_func; i++) {
      if (job.w[i] != wMax) {
        job.w[i] *= w1mMaxPow;
      }
      wSum += job.w[i];
    }

    // Normalize the weights
    for (int i = 0; i < num_func; i++) {
      job.w[i] /= wSum;
    }

    double sumF = 0.0;
    for (int i = 0; i < num_func; i++) {
      for (int j = 0; j < num_dim; j++) {
        job.z[i][j] /= job.lambda[i];
      }
      rotate(job.zM[i], job.z[i], job.linearTransformationMatrix[i]);
      sumF +=
        job.w[i] *
          (
            job.C * job.basicFunc(i, job.zM[i]) / job.fmax[i] +
              job.biases[i]
          );
    }
    return (sumF);
  }
static public double hybrid_composition ( double [ ] x , HCJob job ) throws JMetalException { int num_func = job . numberOfBasicFunctions ; int num_dim = job . numberOfDimensions ; double wMax = Double . NEGATIVE_INFINITY ; for ( int i = 0 ; i < num_func ; i ++ ) { double sumSqr = 0.0 ; shift ( job . z [ i ] , x , job . shiftGlobalOptimum [ i ] ) ; for ( int j = 0 ; j < num_dim ; j ++ ) { sumSqr += ( job . z [ i ] [ j ] * job . z [ i ] [ j ] ) ; } job . w [ i ] = Math . exp ( - 1.0 * sumSqr / ( 2.0 * num_dim * job . sigma [ i ] * job . sigma [ i ] ) ) ; if ( wMax < job . w [ i ] ) { wMax = job . w [ i ] ; } } double wSum = 0.0 ; double w1mMaxPow = 1.0 - Math . pow ( wMax , 10.0 ) ; for ( int i = 0 ; i < num_func ; i ++ ) { if ( job . w [ i ] != wMax ) { job . w [ i ] *= w1mMaxPow ; } wSum += job . w [ i ] ; } for ( int i = 0 ; i < num_func ; i ++ ) { job . w [ i ] /= wSum ; } double sumF = 0.0 ; for ( int i = 0 ; i < num_func ; i ++ ) { for ( int j = 0 ; j < num_dim ; j ++ ) { job . z [ i ] [ j ] /= job . lambda [ i ] ; } rotate ( job . zM [ i ] , job . z [ i ] , job . linearTransformationMatrix [ i ] ) ; sumF += job . w [ i ] * ( job . C * job . basicFunc ( i , job . zM [ i ] ) / job . fmax [ i ] + job . biases [ i ] ) ; } return ( sumF ) ; }
Hybrid composition