Example #1
0
  /**
   * Evaluates a solution
   *
   * @param z The solution to evaluate
   * @return a double [] with the evaluation results
   */
  @Override
  public float[] evaluate(float[] z) {
    float[] y;

    y = normalise(z);
    y = t1(y, k_);
    y = t2(y, k_);
    try {
      y = t3(y);
    } catch (JMException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    y = t4(y, k_, M_);

    float[] result = new float[M_];
    float[] x = calculate_x(y);
    for (int m = 1; m <= M_ - 1; m++) {
      result[m - 1] = D_ * x[M_ - 1] + S_[m - 1] * (new Shapes()).convex(x, m);
    }

    result[M_ - 1] = D_ * x[M_ - 1] + S_[M_ - 1] * (new Shapes()).mixed(x, 5, (float) 1.0);

    return result;
  } // evaluate
  /** Constructor */
  public SPEA2_Settings(String problem) {
    super(problem);

    Object[] problemParams = {"Real"};
    try {
      problem_ = (new ProblemFactory()).getProblem(problemName_, problemParams);
    } catch (JMException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    populationSize_ = 100;
    archiveSize_ = 100;
    maxEvaluations_ = 25000;
    mutationProbability_ = 1.0 / problem_.getNumberOfVariables();
    crossoverProbability_ = 0.9;
    crossoverDistributionIndex_ = 20.0;
    mutationDistributionIndex_ = 20.0;
  } // SPEA2_Settings
Example #3
0
  /** Constructor */
  public CellDE_Settings(String problemName) {
    super(problemName);

    Object[] problemParams = {"Real"};
    try {
      problem_ = (new ProblemFactory()).getProblem(problemName_, problemParams);
    } catch (JMException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    // Default experiments.settings
    CR_ = 0.5;
    F_ = 0.5;

    populationSize_ = 100;
    archiveSize_ = 100;
    maxEvaluations_ = 25000;
    archiveFeedback_ = 20;
  } // CellDE_Settings