Merging rev. 789 (Seitz branch), the AbstractOptimizationProblem now stores the old fitness value in each indy right before a new evaluation.

This commit is contained in:
Marcel Kronfeld 2011-03-14 15:00:52 +00:00
parent f7c43e92c0
commit ed48ddc07c

View File

@ -74,9 +74,13 @@ implements InterfaceOptimizationProblem /*, InterfaceParamControllable*/, Serial
} }
/** /**
* * Tag for data fields concerning a solution to an abstract optimization problem.
*/ */
public static final String STAT_SOLUTION_HEADER = "solution"; public static final String STAT_SOLUTION_HEADER = "solution";
/**
* Store the old fitness array before evaluation.
*/
public static final String OLD_FITNESS_KEY = "oldFitness";
int parallelthreads = 1; int parallelthreads = 1;
@ -166,6 +170,7 @@ implements InterfaceOptimizationProblem /*, InterfaceParamControllable*/, Serial
for (int i = 0; i < population.size(); i++) { for (int i = 0; i < population.size(); i++) {
tmpIndy = (AbstractEAIndividual) population.get(i); tmpIndy = (AbstractEAIndividual) population.get(i);
tmpIndy.putData(OLD_FITNESS_KEY, tmpIndy.getFitness());
synchronized (tmpIndy) { synchronized (tmpIndy) {
tmpIndy.resetConstraintViolation(); tmpIndy.resetConstraintViolation();
this.evaluate(tmpIndy); this.evaluate(tmpIndy);