Generational replacement update
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@199 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
ebd175c05b
commit
cb34e81fee
1 changed files with 17 additions and 3 deletions
|
|
@ -13,13 +13,27 @@
|
||||||
#ifndef MOEOGENERATIONALREPLACEMENT_H_
|
#ifndef MOEOGENERATIONALREPLACEMENT_H_
|
||||||
#define MOEOGENERATIONALREPLACEMENT_H_
|
#define MOEOGENERATIONALREPLACEMENT_H_
|
||||||
|
|
||||||
#include <eoGenerationalReplacement.h>
|
#include <eoReplacement.h>
|
||||||
#include <moeoGenerationalReplacement.h>
|
#include <moeoReplacement.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generational replacement: only the new individuals are preserved.
|
* Generational replacement: only the new individuals are preserved.
|
||||||
*/
|
*/
|
||||||
template < class MOEOT >
|
template < class MOEOT >
|
||||||
class moeoGenerationalReplacement : public moeoReplacement < MOEOT >, public eoGenerationalReplacement < MOEOT > {};
|
class moeoGenerationalReplacement : public moeoReplacement < MOEOT >, public eoGenerationalReplacement < MOEOT >
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Swaps _parents and _offspring
|
||||||
|
* @param _parents the parents population
|
||||||
|
* @param _offspring the offspring population
|
||||||
|
*/
|
||||||
|
void operator()(eoPop < MOEOT > & _parents, eoPop < MOEOT > & _offspring)
|
||||||
|
{
|
||||||
|
eoGenerationalReplacement < MOEOT >::operator ()(_parents, _offspring);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
#endif /*MOEOGENERATIONALREPLACEMENT_H_*/
|
#endif /*MOEOGENERATIONALREPLACEMENT_H_*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue