diff --git a/branches/cmakemodif/paradiseo-moeo/src/algo/moeoSPEA2.h b/branches/cmakemodif/paradiseo-moeo/src/algo/moeoSPEA2.h index b887d3bf1..2296d1ad0 100644 --- a/branches/cmakemodif/paradiseo-moeo/src/algo/moeoSPEA2.h +++ b/branches/cmakemodif/paradiseo-moeo/src/algo/moeoSPEA2.h @@ -129,7 +129,7 @@ public: /** * Ctor with a crossover, a mutation and their corresponding rates. * @param _continuator stopping criteria - * @param _eval evaluation function + popEval * @param _eval evaluation function * @param _op general operator * @param _archive archive * @param _k the k-ieme distance used to fixe diversity @@ -241,14 +241,16 @@ class eoDummyTransform : public eoTransform eoPopLoopEval < MOEOT > loopEval; /** evaluation function used to evaluate the whole population */ eoPopEvalFunc < MOEOT > & popEval; + /**archive*/ + moeoArchive < MOEOT >& archive; /** selectMany */ eoSelectMany selectMany; /** select Transform*/ eoSelectTransform selectTransform; - /** binary tournament selection */ - moeoSelectFromPopAndArch < MOEOT > select; /**SelectOne*/ moeoDetTournamentSelect < MOEOT > defaultSelect; + /** binary tournament selection */ + moeoSelectFromPopAndArch < MOEOT > select; /** fitness assignment used in NSGA-II */ moeoDominanceCountRankingFitnessAssignment < MOEOT > fitnessAssignment; /** diversity assignment used in NSGA-II */ @@ -267,8 +269,7 @@ class eoDummyTransform : public eoTransform eoBreed < MOEOT > & breed; /**distance*/ moeoEuclideanDistance < MOEOT > dist; - /**archive*/ - moeoArchive < MOEOT >& archive; + }; diff --git a/branches/cmakemodif/paradiseo-moeo/src/archive/moeoSPEA2Archive.h b/branches/cmakemodif/paradiseo-moeo/src/archive/moeoSPEA2Archive.h index d9f3a2762..182303e92 100644 --- a/branches/cmakemodif/paradiseo-moeo/src/archive/moeoSPEA2Archive.h +++ b/branches/cmakemodif/paradiseo-moeo/src/archive/moeoSPEA2Archive.h @@ -141,12 +141,12 @@ public: */ void operator()(const eoPop < MOEOT > & _pop) { - unsigned int i=0; + unsigned int i; unsigned int foo=0; //Creation of the vector that contains minimal pop's informations std::vector copy_pop(_pop.size()); - for (i;i<_pop.size(); i++) + for (i=0;i<_pop.size(); i++) { copy_pop[i].index=i; copy_pop[i].fitness=_pop[i].fitness(); @@ -250,7 +250,7 @@ public: for (l=0; l=0; i--) + for (int i=_pop.size()-2; i>=0; i--) { if (_pop[i].objectiveVector() != _pop[i+1].objectiveVector()) {