git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@1574 331e1502-861f-0410-8da2-ba01fb791d7f

This commit is contained in:
jhumeau 2009-03-26 14:49:24 +00:00
commit 224e52b4c7
2 changed files with 11 additions and 4 deletions

View file

@ -13,16 +13,21 @@ class eoAmeliorationContinue: public eoContinue<EOT>
{ {
public: public:
eoAmeliorationContinue(moeoDMLSArchive<EOT> & _arch, unsigned int _maxGen) : arch(_arch), maxGen(_maxGen), counter(0){} eoAmeliorationContinue(moeoDMLSArchive<EOT> & _arch, unsigned int _neighborhoodSize) : arch(_arch),maxGen(_neighborhoodSize), neighborhoodSize(_neighborhoodSize), counter(0){}
// _pop must be an archive // _pop must be an archive
virtual bool operator() (const eoPop<EOT> & _pop) virtual bool operator() (const eoPop<EOT> & _pop)
{ {
bool res;
maxGen=arch.size() * neighborhoodSize;
if(arch.modified()) if(arch.modified())
counter=0; counter=0;
else else
counter++; counter++;
return (counter < maxGen); res = (counter < maxGen);
if(!res)
counter=0;
return res;
} }
virtual std::string className(void) const virtual std::string className(void) const
@ -34,6 +39,7 @@ private:
moeoDMLSArchive <EOT> & arch; moeoDMLSArchive <EOT> & arch;
unsigned int maxGen; unsigned int maxGen;
unsigned int neighborhoodSize;
unsigned int counter; unsigned int counter;
}; };

View file

@ -57,12 +57,13 @@ public:
moeoRestartLS( moeoRestartLS(
eoInit < MOEOT > & _init, eoInit < MOEOT > & _init,
eoEvalFunc < MOEOT > & _eval, eoEvalFunc < MOEOT > & _eval,
eoContinue < MOEOT > & _continuator, eoContinue < MOEOT > & _continuator1,
eoContinue < MOEOT > & _continuator2,
moeoPopNeighborhoodExplorer < Move > & _explorer, moeoPopNeighborhoodExplorer < Move > & _explorer,
moeoUnvisitedSelect < MOEOT > & _select, moeoUnvisitedSelect < MOEOT > & _select,
moeoArchive < MOEOT > & _globalArchive, moeoArchive < MOEOT > & _globalArchive,
std::string _fileName) : std::string _fileName) :
init(_init), eval(_eval), continuator(_continuator), ls(continuator, _eval, internalArchive, _explorer, _select), globalArchive(_globalArchive), fileName(_fileName), count(0) {} init(_init), eval(_eval), continuator(_continuator1), ls(_continuator2, _eval, internalArchive, _explorer, _select), globalArchive(_globalArchive), fileName(_fileName), count(0) {}
virtual void operator()(eoPop<MOEOT> & _pop) virtual void operator()(eoPop<MOEOT> & _pop)