Exemplo n.º 1
0
  /**
   * Constructor
   *
   * @param problem Problem to solve
   */
  public SMPSO(Problem problem, String trueParetoFront) throws FileNotFoundException {
    super(problem);
    hy_ = new Hypervolume();
    jmetal.qualityIndicator.util.MetricsUtil mu = new jmetal.qualityIndicator.util.MetricsUtil();
    trueFront_ = mu.readNonDominatedSolutionSet(trueParetoFront);
    trueHypervolume_ =
        hy_.hypervolume(
            trueFront_.writeObjectivesToMatrix(),
            trueFront_.writeObjectivesToMatrix(),
            problem_.getNumberOfObjectives());

    // Default configuration
    r1Max_ = 1.0;
    r1Min_ = 0.0;
    r2Max_ = 1.0;
    r2Min_ = 0.0;
    C1Max_ = 2.5;
    C1Min_ = 1.5;
    C2Max_ = 2.5;
    C2Min_ = 1.5;
    WMax_ = 0.1;
    WMin_ = 0.1;
    ChVel1_ = -1;
    ChVel2_ = -1;
  } // Constructor
Exemplo n.º 2
0
  public SMPSO(Problem problem, Vector<Double> variables, String trueParetoFront)
      throws FileNotFoundException {
    super(problem);

    r1Max_ = variables.get(0);
    r1Min_ = variables.get(1);
    r2Max_ = variables.get(2);
    r2Min_ = variables.get(3);
    C1Max_ = variables.get(4);
    C1Min_ = variables.get(5);
    C2Max_ = variables.get(6);
    C2Min_ = variables.get(7);
    WMax_ = variables.get(8);
    WMin_ = variables.get(9);
    ChVel1_ = variables.get(10);
    ChVel2_ = variables.get(11);

    hy_ = new Hypervolume();
    jmetal.qualityIndicator.util.MetricsUtil mu = new jmetal.qualityIndicator.util.MetricsUtil();
    trueFront_ = mu.readNonDominatedSolutionSet(trueParetoFront);
    trueHypervolume_ =
        hy_.hypervolume(
            trueFront_.writeObjectivesToMatrix(),
            trueFront_.writeObjectivesToMatrix(),
            problem_.getNumberOfObjectives());
  } // SMPSO