From 4c667c0dce790d03ee2ab4c802b6943a674bd560 Mon Sep 17 00:00:00 2001 From: wcancino Date: Sun, 22 Feb 2009 18:02:30 +0000 Subject: [PATCH] fix compilation issues git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1460 331e1502-861f-0410-8da2-ba01fb791d7f --- contribution/branches/PhyloMOEA/PhyloMOEA/moeoNSGAII2.h | 2 +- .../branches/PhyloMOEA/PhyloMOEA/moeoPtrComparator.h | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/contribution/branches/PhyloMOEA/PhyloMOEA/moeoNSGAII2.h b/contribution/branches/PhyloMOEA/PhyloMOEA/moeoNSGAII2.h index 06b00d732..0ca267d5e 100644 --- a/contribution/branches/PhyloMOEA/PhyloMOEA/moeoNSGAII2.h +++ b/contribution/branches/PhyloMOEA/PhyloMOEA/moeoNSGAII2.h @@ -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; diff --git a/contribution/branches/PhyloMOEA/PhyloMOEA/moeoPtrComparator.h b/contribution/branches/PhyloMOEA/PhyloMOEA/moeoPtrComparator.h index cec418139..b36e62fd3 100644 --- a/contribution/branches/PhyloMOEA/PhyloMOEA/moeoPtrComparator.h +++ b/contribution/branches/PhyloMOEA/PhyloMOEA/moeoPtrComparator.h @@ -23,8 +23,11 @@ #include /** - * 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 & _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);