From 265be972ef282138a2290100809b3b40c72960df Mon Sep 17 00:00:00 2001 From: evomarc Date: Fri, 17 Nov 2000 17:50:08 +0000 Subject: [PATCH] Made eoBestFitnessStat an eoStat, NOT an eoSortedStat Cde VS: Committing in . --- eo/src/utils/eoStat.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/eo/src/utils/eoStat.h b/eo/src/utils/eoStat.h index 037ca409..4c60ec9b 100644 --- a/eo/src/utils/eoStat.h +++ b/eo/src/utils/eoStat.h @@ -134,13 +134,31 @@ private : unsigned which; }; +/* Actually, you don't need to sort the population to get the best fitness + MS - 17/11/00 +template +class eoBestFitnessStat : public eoStat +{ +public : + typedef typename EOT::Fitness Fitness; + + eoBestFitnessStat(std::string _description = "Best Fitness") : + eoStat(Fitness(), _description) {} + + virtual void operator()(const eoPop& _pop) + { + value() = _pop.nth_element_fitness(0); + } + +}; +*/ template class eoBestFitnessStat : public eoNthElementFitnessStat { public : typedef typename EOT::Fitness Fitness; - + eoBestFitnessStat(std::string _description = "Best Fitness") : eoNthElementFitnessStat(0, _description) {} };