コード例 #1
0
ファイル: UF11.java プロジェクト: dukeboard/kevoree-genetic
  @Override
  public void evaluate(Solution solution) {
    double[] x = EncodingUtils.getReal(solution);
    double[] psum = new double[numberOfObjectives];
    double[] zz = new double[numberOfVariables];

    // apply transform to convert from UF11 to DTLZ2
    CEC2009.transform(
        x,
        zz,
        psum,
        numberOfVariables == 10 ? M_10D : M_30D,
        numberOfVariables == 10 ? lamda_l_10D : lamda_l_30D,
        numberOfVariables,
        numberOfObjectives);

    // evaluate the transformed solution with DTLZ2
    Solution transformedSolution = problem.newSolution();
    EncodingUtils.setReal(transformedSolution, zz);
    problem.evaluate(transformedSolution);

    // convert the DTLZ2 results back to UF11
    for (int i = 0; i < numberOfObjectives; i++) {
      solution.setObjective(
          i, 2.0 / (1.0 + Math.exp(-psum[i])) * (transformedSolution.getObjective(i) + 1));
    }
  }
コード例 #2
0
ファイル: ConvexDTLZ2.java プロジェクト: Gan0k/MOEAFramework
  @Override
  public void evaluate(Solution solution) {
    super.evaluate(solution);

    for (int i = 0; i < numberOfObjectives - 1; i++) {
      solution.setObjective(i, Math.pow(solution.getObjective(i), 4.0));
    }

    solution.setObjective(
        numberOfObjectives - 1, Math.pow(solution.getObjective(numberOfObjectives - 1), 2.0));
  }