git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1571 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
c2341a6502
commit
ef8d881c7c
6 changed files with 224 additions and 246 deletions
|
|
@ -5,48 +5,36 @@
|
|||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <eoContinue.h>
|
||||
#include <moeoDMLSArchive.h>
|
||||
#include <archive/moeoArchive.h>
|
||||
|
||||
template< class EOT>
|
||||
class eoAmeliorationContinue: public eoContinue<EOT>
|
||||
{
|
||||
public:
|
||||
|
||||
eoAmeliorationContinue(unsigned int _maxGen) : maxGen(_maxGen), counter(0){}
|
||||
|
||||
eoAmeliorationContinue(moeoDMLSArchive<EOT> & _arch, unsigned int _maxGen) : arch(_arch), maxGen(_maxGen), counter(0){}
|
||||
|
||||
// _pop must be an archive
|
||||
virtual bool operator() (const eoPop<EOT> & _pop)
|
||||
{
|
||||
if(_pop.modified())
|
||||
std::cout << counter << std::endl;
|
||||
if(arch.modified())
|
||||
counter=0;
|
||||
else
|
||||
counter++;
|
||||
return (counter < maxGen);
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual std::string className(void) const
|
||||
{
|
||||
return "eoAmeliorationContinue";
|
||||
}
|
||||
|
||||
|
||||
void readFrom (std :: istream & __is)
|
||||
{
|
||||
|
||||
__is >> start;
|
||||
}
|
||||
|
||||
|
||||
void printOn (std :: ostream & __os) const
|
||||
{
|
||||
|
||||
__os << start << ' ' << std :: endl;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
unsigned int maxGeneration;
|
||||
moeoDMLSArchive <EOT> & arch;
|
||||
unsigned int maxGen;
|
||||
unsigned int counter;
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue