Menu

#9 Bug in CMAES.java

V4.5
open
nobody
None
5
2015-04-07
2015-04-07
No

Hi!

In the file "jmetal/metaheuristics/singleObjective/cmaes/CMAES.java", in the iteration loop of the method "execute()", the line "counteval += populationSize;" should be outside the loop over the individuals of the population. The corrected piece of source code would be:

     for(int i = 0; i < populationSize; i++) {
        if (!isFeasible(population_.get(i))) {
          //System.out.println("RESAMPLING!");
          population_.replace(i, resampleSingle(i));
        }
        problem_.evaluate(population_.get(i));
      }

      counteval += populationSize;
      storeBest(comparator);

instead of:

      for(int i = 0; i < populationSize; i++) {
        if (!isFeasible(population_.get(i))) {
          //System.out.println("RESAMPLING!");
          population_.replace(i, resampleSingle(i));
        }
        problem_.evaluate(population_.get(i));

        counteval += populationSize;

      }

      storeBest(comparator);

Best regards,
Julien

Discussion


Log in to post a comment.

MongoDB Logo MongoDB