fix compilation issues

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1460 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
wcancino 2009-02-22 18:02:30 +00:00
commit 4c667c0dce
2 changed files with 8 additions and 2 deletions

View file

@ -201,7 +201,7 @@ protected:
/** fitness assignment used in NSGA */
moeoDominanceDepthFitnessAssignment < MOEOT > fitnessAssignment;
/** diversity assignment used in NSGA-II */
moeoFrontByFrontCrowdingDiversityAssignment2 < MOEOT > diversityAssignment;
moeoFrontByFrontCrowdingDiversityAssignment < MOEOT > diversityAssignment;
/** elitist replacement */
moeoElitistReplacement < MOEOT > replace;

View file

@ -23,8 +23,11 @@
#include <comparator/moeoComparator.h>
/**
* Functor allowing to compare two solutions.referenced by pointers
* Functor allowing to compare two solutions.referenced by pointers.
* Several MOEO related stuff have to sort populations according some criterion
* Instead to do this, we used a vector whose elements are pointers to true individuals
*/
template < class MOEOT >
class moeoPtrComparator : public eoBF < const MOEOT *, const MOEOT *, const bool >
{
@ -36,11 +39,14 @@ class moeoPtrComparator : public eoBF < const MOEOT *, const MOEOT *, const bool
*/
moeoPtrComparator( moeoComparator<MOEOT> & _cmp) : cmp(_cmp) {}
/** compare two const individuals */
const bool operator() (const MOEOT *ptr1, const MOEOT *ptr2)
{
return cmp(*ptr1, *ptr2);
}
/** compare two non const individuals */
const bool operator() (MOEOT *ptr1, MOEOT *ptr2)
{
return cmp(*ptr1, *ptr2);