From 45a2d08432942c1998786cbb28af9604f0cd6e18 Mon Sep 17 00:00:00 2001 From: evomarc Date: Tue, 2 Sep 2003 05:49:37 +0000 Subject: [PATCH] Slightly modified the formula: the worst individual had "fitness" 0 in hte case of linear scaling with pressure=2. Now it has fitness 1/[P(P-1)/2] Thanks to Gilles BAUDRILLARD (EADS) --- eo/src/eoRanking.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eo/src/eoRanking.h b/eo/src/eoRanking.h index 5b7421be..3918cc53 100644 --- a/eo/src/eoRanking.h +++ b/eo/src/eoRanking.h @@ -81,7 +81,7 @@ public: for (unsigned i=0; i 1/[P(P-1)/2] } } else // exponent != 1 @@ -91,7 +91,7 @@ public: { int which = lookfor(rank[i], _pop); // value in in [0,1] - double tmp = ((double)(pSizeMinusOne-i))/pSizeMinusOne; + double tmp = ((double)(pSize-i))/pSize; // to the exponent, and back to [m,M] value()[which] = gamma*pow(tmp, exponent)+beta; }