new indent, mo_roulette to implement in selectors
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@218 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
3298fadc1e
commit
f20b1a21b4
1 changed files with 16 additions and 16 deletions
|
|
@ -20,16 +20,16 @@
|
||||||
* Selection strategy that selects ONE individual by using roulette wheel process.
|
* Selection strategy that selects ONE individual by using roulette wheel process.
|
||||||
*/
|
*/
|
||||||
template < class MOEOT >
|
template < class MOEOT >
|
||||||
class moeoRouletteSelect:public moeoSelectOne <MOEOT>
|
class moeoRouletteSelect:public moeoSelectOne <MOEOT>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Full Ctor.
|
* Full Ctor.
|
||||||
* @param _comparator the comparator (used to compare 2 individuals)
|
* @param _comparator the comparator (used to compare 2 individuals)
|
||||||
* @param _tSize the number of individuals in the tournament (default: 2)
|
* @param _tSize the number of individuals in the tournament (default: 2)
|
||||||
*/
|
*/
|
||||||
moeoRouletteSelect (moeoComparator < MOEOT > &_comparator, unsigned _tSize = 2):
|
moeoRouletteSelect (moeoComparator < MOEOT > &_comparator, unsigned _tSize = 2):
|
||||||
comparator (_comparator), tSize (_tSize)
|
comparator (_comparator), tSize (_tSize)
|
||||||
{
|
{
|
||||||
|
|
@ -60,21 +60,21 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply the tournament to the given population
|
* Apply the tournament to the given population
|
||||||
*/
|
*/
|
||||||
const MOEOT & operator () (const eoPop < MOEOT > &_pop)
|
const MOEOT & operator () (const eoPop < MOEOT > &_pop)
|
||||||
{
|
{
|
||||||
// use the selector
|
// use the selector
|
||||||
return mo_roulette_wheel(_pop,total); //comparator ??
|
return mo_roulette_wheel(_pop,total); //comparator ??
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
moeoComparator < MOEOT > &comparator;
|
moeoComparator < MOEOT > &comparator;
|
||||||
|
|
||||||
double & total;
|
double & total;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue