From 740275b31a31b02ac15c4b3d5356a157ca99b39b Mon Sep 17 00:00:00 2001 From: Johann Dreo Date: Thu, 22 Nov 2012 14:47:13 +0100 Subject: [PATCH] more generic eoSecondMomentStats: use EOT::Fitness instead of double --- eo/src/utils/eoStat.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/eo/src/utils/eoStat.h b/eo/src/utils/eoStat.h index e7c5adca2..c932fb353 100644 --- a/eo/src/utils/eoStat.h +++ b/eo/src/utils/eoStat.h @@ -179,15 +179,13 @@ private : Average fitness + Std. dev. of a population, fitness needs to be scalar. */ template -class eoSecondMomentStats : public eoStat > +class eoSecondMomentStats : public eoStat > { public : + typedef typename EOT::Fitness FitT; - using eoStat >::value; - - typedef typename EOT::Fitness fitness_type; - - typedef std::pair SquarePair; + using eoStat >::value; + typedef std::pair SquarePair; eoSecondMomentStats(std::string _description = "Average & Stdev") : eoStat(std::make_pair(0.0,0.0), _description) @@ -195,7 +193,7 @@ public : static SquarePair sumOfSquares(SquarePair _sq, const EOT& _eo) { - double fitness = _eo.fitness(); + FitT fitness = _eo.fitness(); _sq.first += fitness; _sq.second += fitness * fitness;