More details to make code MSVC-compatible

This commit is contained in:
evomarc 2001-12-03 11:08:17 +00:00
commit 512d368dcf
3 changed files with 8 additions and 7 deletions

View file

@ -66,7 +66,8 @@ public:
// average fitness
double sum=0.0;
for (unsigned i=0; i<pSize; i++)
unsigned i;
for (i=0; i<pSize; i++)
sum += static_cast<double>(_pop[i].fitness());
double averageFitness = sum/pSize;
@ -75,7 +76,7 @@ public:
double alpha = (pressure-1)/denom;
double beta = (bestFitness - pressure*averageFitness)/denom;
for (unsigned i=0; i<pSize; i++) // truncate to 0
for (i=0; i<pSize; i++) // truncate to 0
{
value()[i] = max(alpha*_pop[i].fitness()+beta, 0.0);
}