X-Git-Url: https://git.dlugolecki.net.pl/?p=genetic.git;a=blobdiff_plain;f=include%2Fcondition%2FgenerationLimitCondition.h;h=e120a9655a99bbf1f3b04409677c44a733ac2c6a;hp=455fda49a92f67c39468df993651b54ebec00e48;hb=0c268e96035b65112e449c1c0df49f2be3eb184f;hpb=917440678dc4e920dfd5810da1274665acb17138 diff --git a/include/condition/generationLimitCondition.h b/include/condition/generationLimitCondition.h index 455fda4..e120a96 100644 --- a/include/condition/generationLimitCondition.h +++ b/include/condition/generationLimitCondition.h @@ -34,7 +34,7 @@ namespace genetic { * @return true if limit is not reached and another iteration of * calculations should be started, false otherwise */ - bool do_check(Generation<_Chromosome> &) { + bool do_check(const Generation<_Chromosome> &) { /* Initial population is never checked, as method is invoked after * selection, crossover and mutation. It is safe to increment it now. */ @@ -52,7 +52,7 @@ namespace genetic { * * @param limit number of generations after which algorithm should stop */ - GenerationLimitCondition(unsigned int limit) + GenerationLimitCondition(const unsigned int limit) : maxNumberOfGenerations(limit) { } };