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:
parent
6fece409a7
commit
729fa74b42
1 changed files with 2 additions and 2 deletions
|
|
@ -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.
|
||||||
|
|
|
||||||
Reference in a new issue