X-Git-Url: https://git.dlugolecki.net.pl/?p=genetic.git;a=blobdiff_plain;f=include%2Fcondition%2Fcondition.h;h=eea77d593accd1210719ce14db78882042505394;hp=3562129a1666999eaad86ea0249029a80012c569;hb=917440678dc4e920dfd5810da1274665acb17138;hpb=c7bf950f7db8b2e5843fbead4851d80202570af2 diff --git a/include/condition/condition.h b/include/condition/condition.h index 3562129..eea77d5 100644 --- a/include/condition/condition.h +++ b/include/condition/condition.h @@ -19,24 +19,24 @@ namespace genetic { * If condition is satisfied, we can check another generation. * All the custom Condition checks should be invoked in this method. * - * @param generation current generation to check + * @param generation reference of current generation to check * * @return true if condition is satisfied and another generation can checked; * false if condition is not satisfied and algorithm should stop. */ - virtual bool do_check(Generation<_Chromosome>) = 0; + virtual bool do_check(Generation<_Chromosome>&) = 0; public: /** * Checks if current generation passes stop condition. * If condition is satisfied, we can check another generation. * - * @param generation current generation to check + * @param generation reference of current generation to check * * @return true if condition is satisfied and another generation can checked; * false if condition is not satisfied and algorithm should stop. */ - bool check(Generation<_Chromosome> generation) { + bool check(Generation<_Chromosome>& generation) { return do_check(generation); } };