I have change the do...while(terminator) into while(terminator){...}, because may be the termination condition is reached just atthe beginning (for instance 0 generations)

This commit is contained in:
victor 2000-01-18 13:43:39 +00:00
commit 729fa74b42

View file

@ -57,7 +57,7 @@ template<class Chrom> class eoEasyEA: public eoAlgo<Chrom>
/// Apply one generation of evolution to the population. /// Apply one generation of evolution to the population.
virtual void operator()(eoPop<Chrom>& pop) { virtual void operator()(eoPop<Chrom>& pop) {
do { while ( terminator( pop ) ){
try try
{ {
step(pop); step(pop);
@ -68,7 +68,7 @@ template<class Chrom> class eoEasyEA: public eoAlgo<Chrom>
s.append( " in eoEasyEA "); s.append( " in eoEasyEA ");
throw runtime_error( s ); throw runtime_error( s );
} }
} while ( terminator( pop ) ); }
} }
/// Class name. /// Class name.