23/02/07 modifications

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@184 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
liefooga 2007-02-23 12:49:11 +00:00
commit 086b51c370
20 changed files with 772 additions and 970 deletions

View file

@ -17,32 +17,34 @@
#include <eoPop.h>
/**
* Functor that sets the diversity values of a whole population
* Functor that sets the diversity values of a whole population.
*/
template < class MOEOT > class moeoDiversityAssignment:public eoUF < eoPop < MOEOT > &,
void >
{
};
template < class MOEOT >
class moeoDiversityAssignment : public eoUF < eoPop < MOEOT > &, void >
{};
/**
* moeoDummyDiversityAssignment is a moeoDiversityAssignment which gives 0 as the diversity for the whole population.
* moeoDummyDiversityAssignment is a moeoDiversityAssignment that gives the value '0' as the individual's diversity for a whole population.
*/
template < class MOEOT > class moeoDummyDiversityAssignment:public moeoDiversityAssignment <
MOEOT >
template < class MOEOT >
class moeoDummyDiversityAssignment : public moeoDiversityAssignment < MOEOT >
{
// main operator
void operator () (eoPop < MOEOT > &_pop)
{
for (int idx = 0; idx < _pop.size (); idx++)
{
// set the diversity to 0
_pop[idx].diversity (0);
}
}
public:
/**
* Sets the diversity to '0' for every individuals of the population _pop
* @param _pop the population
*/
void operator () (eoPop < MOEOT > & _pop)
{
for (unsigned idx = 0; idx<_pop.size (); idx++)
{
// set the diversity to 0
_pop[idx].diversity(0);
}
}
};
#endif /*MOEODIVERSITYASSIGNMENT_H_ */
#endif /*MOEODIVERSITYASSIGNMENT_H_*/