diff --git a/moeo/src/archive/moeoSPEA2Archive.h b/moeo/src/archive/moeoSPEA2Archive.h index f5b60e63f..d2c64b83a 100644 --- a/moeo/src/archive/moeoSPEA2Archive.h +++ b/moeo/src/archive/moeoSPEA2Archive.h @@ -81,7 +81,7 @@ class moeoSPEA2Archive : public moeoFixedSizeArchive < MOEOT > * Default ctor. * @param _maxSize the size of archive (must be smaller or equal to the population size) */ - moeoSPEA2Archive(unsigned int _maxSize=100): moeoFixedSizeArchive < MOEOT >(true), maxSize(_maxSize), borne(0), indiComparator(defaultComparator), distance(defaultDistance) + moeoSPEA2Archive(unsigned int _maxSize=100): moeoFixedSizeArchive < MOEOT >(true), maxSize(_maxSize), borne(0), defaultComparator(), indiComparator(defaultComparator), defaultDistance(), distance(defaultDistance) {} @@ -90,7 +90,7 @@ class moeoSPEA2Archive : public moeoFixedSizeArchive < MOEOT > * @param _dist the distance used * @param _maxSize the size of archive (must be smaller or egal to the population size) */ - moeoSPEA2Archive(moeoDistance & _dist, unsigned int _maxSize=100): moeoFixedSizeArchive < MOEOT >(true), maxSize(_maxSize), borne(0), indiComparator(defaultComparator), distance(_dist) + moeoSPEA2Archive(moeoDistance & _dist, unsigned int _maxSize=100): moeoFixedSizeArchive < MOEOT >(true), maxSize(_maxSize), borne(0), defaultComparator(), indiComparator(defaultComparator), distance(_dist) {} @@ -99,7 +99,7 @@ class moeoSPEA2Archive : public moeoFixedSizeArchive < MOEOT > * @param _comparator the functor used to compare objective vectors * @param _maxSize the size of archive (must be smaller or egal to the population size) */ - moeoSPEA2Archive(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, unsigned int _maxSize=100): moeoFixedSizeArchive < MOEOT >(_comparator, true), maxSize(_maxSize), borne(0), indiComparator(defaultComparator), distance(defaultDistance) + moeoSPEA2Archive(moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, unsigned int _maxSize=100): moeoFixedSizeArchive < MOEOT >(_comparator, true), maxSize(_maxSize), borne(0), defaultComparator(), indiComparator(defaultComparator), defaultDistance(), distance(defaultDistance) {} @@ -108,7 +108,7 @@ class moeoSPEA2Archive : public moeoFixedSizeArchive < MOEOT > * @param _indiComparator the functor used to compare MOEOT * @param _maxSize the size of archive (must be smaller or egal to the population size) */ - moeoSPEA2Archive(moeoComparator & _indiComparator, unsigned int _maxSize=100): moeoFixedSizeArchive < MOEOT >(true), maxSize(_maxSize), borne(0), indiComparator(_indiComparator), distance(defaultDistance) + moeoSPEA2Archive(moeoComparator & _indiComparator, unsigned int _maxSize=100): moeoFixedSizeArchive < MOEOT >(true), maxSize(_maxSize), borne(0), defaultComparator(), indiComparator(_indiComparator), defaultDistance(), distance(defaultDistance) {} @@ -119,7 +119,7 @@ class moeoSPEA2Archive : public moeoFixedSizeArchive < MOEOT > * @param _comparator the functor used to compare objective vectors * @param _maxSize the size of archive (must be smaller or egal to the population size) */ - moeoSPEA2Archive(moeoComparator & _indiComparator, moeoDistance & _dist, moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, unsigned int _maxSize=100) : moeoFixedSizeArchive < MOEOT >(_comparator, true), maxSize(_maxSize), borne(0), indiComparator(_indiComparator), distance(_dist) + moeoSPEA2Archive(moeoComparator & _indiComparator, moeoDistance & _dist, moeoObjectiveVectorComparator < ObjectiveVector > & _comparator, unsigned int _maxSize=100) : moeoFixedSizeArchive < MOEOT >(_comparator, true), maxSize(_maxSize), borne(0), defaultComparator(), indiComparator(_indiComparator), distance(_dist) {} @@ -283,11 +283,12 @@ class moeoSPEA2Archive : public moeoFixedSizeArchive < MOEOT > private: - /** archive max size */ unsigned int maxSize; /** archive size */ unsigned int borne; + /** default moeoComparator*/ + moeoFitnessThenDiversityComparator < MOEOT > defaultComparator; /** * Wrapper which allow to used an moeoComparator in std::sort * @param _comp the comparator to used @@ -314,12 +315,10 @@ class moeoSPEA2Archive : public moeoFixedSizeArchive < MOEOT > moeoComparator < MOEOT > & comp; } indiComparator; - /** default moeoComparator*/ - moeoFitnessThenDiversityComparator < MOEOT > defaultComparator; - /** distance */ - moeoDistance & distance; /** default distance */ moeoEuclideanDistance < MOEOT > defaultDistance; + /** distance */ + moeoDistance & distance; /**