update and new stuffs

git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@203 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
liefooga 2007-03-14 16:33:28 +00:00
commit 8f5ccd0d12
9 changed files with 158 additions and 239 deletions

View file

@ -25,7 +25,7 @@ class moeoDiversityAssignment : public eoUF < eoPop < MOEOT > &, void >
/**
* moeoDummyDiversityAssignment is a moeoDiversityAssignment that gives the value '0' as the individual's diversity for a whole population.
* moeoDummyDiversityAssignment is a moeoDiversityAssignment that gives the value '0' as the individual's diversity for a whole population if it is invalid.
*/
template < class MOEOT >
class moeoDummyDiversityAssignment : public moeoDiversityAssignment < MOEOT >
@ -33,15 +33,18 @@ class moeoDummyDiversityAssignment : public moeoDiversityAssignment < MOEOT >
public:
/**
* Sets the diversity to '0' for every individuals of the population _pop
* Sets the diversity to '0' for every individuals of the population _pop if it is invalid
* @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);
if (_pop[idx].invalidDiversity())
{
// set the diversity to 0
_pop[idx].diversity(0.0);
}
}
}