rm fit and div, replace constructors and indent
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@215 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
d710dc0d6c
commit
f9d9271618
1 changed files with 14 additions and 21 deletions
|
|
@ -17,32 +17,25 @@
|
|||
#include <eoRandomSelect.h>
|
||||
|
||||
/**
|
||||
* Selection strategy that selects only one element randomly from a whole population. Neither the fitness nor the diversity of the individuals is required here.
|
||||
* Selection strategy that selects only one element randomly from a whole population.
|
||||
*/
|
||||
template < class MOEOT > class moeoRandomSelect:public moeoSelectOne < MOEOT >, public eoRandomSelect <MOEOT >
|
||||
{
|
||||
public:
|
||||
|
||||
/**
|
||||
* Ctor.
|
||||
*/
|
||||
moeoRandomSelect(){}
|
||||
|
||||
/**
|
||||
* Do nothing: we don't need to evaluate the fitness and the diversity; we only select one individual randomly.
|
||||
*/
|
||||
void setup (eoPop < MOEOT > &_pop)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
/**
|
||||
* Ctor.
|
||||
*/
|
||||
moeoRandomSelect(){}
|
||||
|
||||
/**
|
||||
* Return one individual at random.
|
||||
*/
|
||||
const MOEOT & operator () (const eoPop < MOEOT > &_pop)
|
||||
{
|
||||
eoRandomSelect < MOEOT >::operator ()(_pop);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return one individual at random by using an eoRandomSelect.
|
||||
*/
|
||||
const MOEOT & operator () (const eoPop < MOEOT > &_pop)
|
||||
{
|
||||
eoRandomSelect < MOEOT >::operator ()(_pop);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue