documentation modifications
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@178 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
f3bf6dcb10
commit
4b45aadd5d
16 changed files with 76 additions and 73 deletions
|
|
@ -22,8 +22,8 @@
|
|||
/**
|
||||
* Elitist selection process that consists in choosing individuals in the archive as well as in the current population.
|
||||
*/
|
||||
template<class EOT>
|
||||
class moeoSelectOneFromPopAndArch : public moeoSelectOne<EOT>
|
||||
template < class MOEOT >
|
||||
class moeoSelectOneFromPopAndArch : public moeoSelectOne < MOEOT >
|
||||
{
|
||||
public:
|
||||
|
||||
|
|
@ -34,24 +34,25 @@ public:
|
|||
* @param _arch the archive
|
||||
* @param _ratioFromPop the ratio of selected individuals from the population
|
||||
*/
|
||||
moeoSelectOneFromPopAndArch (moeoSelectOne<EOT> & _popSelectOne, moeoSelectOne<EOT> _archSelectOne, moeoArchive <EOT> & _arch, double _ratioFromPop=0.5)
|
||||
moeoSelectOneFromPopAndArch (moeoSelectOne < MOEOT > & _popSelectOne, moeoSelectOne < MOEOT > _archSelectOne, moeoArchive < MOEOT > & _arch, double _ratioFromPop=0.5)
|
||||
: popSelectOne(_popSelectOne), archSelectOne(_archSelectOne), arch(_arch), ratioFromPop(_ratioFromPop)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Ctor - the archive's selection operator is a random selector
|
||||
* Defaulr ctor - the archive's selection operator is a random selector
|
||||
* @param _popSelectOne the population's selection operator
|
||||
* @param _arch the archive
|
||||
* @param _ratioFromPop the ratio of selected individuals from the population
|
||||
*/
|
||||
moeoSelectOneFromPopAndArch (moeoSelectOne<EOT> & _popSelectOne, moeoArchive <EOT> & _arch, double _ratioFromPop=0.5)
|
||||
moeoSelectOneFromPopAndArch (moeoSelectOne < MOEOT > & _popSelectOne, moeoArchive < MOEOT > & _arch, double _ratioFromPop=0.5)
|
||||
: popSelectOne(_popSelectOne), archSelectOne(randomSelectOne), arch(_arch), ratioFromPop(_ratioFromPop)
|
||||
{}
|
||||
|
||||
/**
|
||||
* The selection process
|
||||
*/
|
||||
virtual const EOT & operator () (const eoPop<EOT> & pop) {
|
||||
virtual const MOEOT & operator () (const eoPop < MOEOT > & pop)
|
||||
{
|
||||
if (arch.size() > 0)
|
||||
if (rng.flip(ratioFromPop))
|
||||
return popSelectOne(pop);
|
||||
|
|
@ -64,7 +65,8 @@ public:
|
|||
/**
|
||||
* Setups some population stats
|
||||
*/
|
||||
virtual void setup (const eoPop<EOT> & _pop) {
|
||||
virtual void setup (const eoPop < MOEOT > & _pop)
|
||||
{
|
||||
popSelectOne.setup(_pop);
|
||||
}
|
||||
|
||||
|
|
@ -72,15 +74,15 @@ public:
|
|||
private:
|
||||
|
||||
/** The population's selection operator */
|
||||
moeoSelectOne<EOT> & popSelectOne;
|
||||
moeoSelectOne < MOEOT > & popSelectOne;
|
||||
/** The archive's selection operator */
|
||||
moeoSelectOne<EOT> & archSelectOne;
|
||||
moeoSelectOne < MOEOT > & archSelectOne;
|
||||
/** The archive */
|
||||
moeoArchive <EOT> & arch;
|
||||
moeoArchive < MOEOT > & arch;
|
||||
/** The ratio of selected individuals from the population*/
|
||||
double ratioFromPop;
|
||||
/** A random selection operator */
|
||||
moeoRandomSelectOne<EOT> randomSelectOne;
|
||||
/** A random selection operator (used as default for archSelectOne) */
|
||||
moeoRandomSelectOne< MOEOT > randomSelectOne;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue