git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1569 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
c84b5db20f
commit
950ec58a6e
3 changed files with 81 additions and 9 deletions
54
contribution/branches/MOLS/src2/eoAmeliorationContinue.h
Normal file
54
contribution/branches/MOLS/src2/eoAmeliorationContinue.h
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#ifndef _eoAmeliorationContinue_h
|
||||
#define _eoAmeliorationContinue_h
|
||||
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <eoContinue.h>
|
||||
|
||||
template< class EOT>
|
||||
class eoAmeliorationContinue: public eoContinue<EOT>
|
||||
{
|
||||
public:
|
||||
|
||||
eoAmeliorationContinue(unsigned int _maxGen) : maxGen(_maxGen), counter(0){}
|
||||
|
||||
|
||||
// _pop must be an archive
|
||||
virtual bool operator() (const eoPop<EOT> & _pop)
|
||||
{
|
||||
if(_pop.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;
|
||||
unsigned int counter;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue