Turned the power function to sum - was untractable with long bitstrings

This commit is contained in:
evomarc 2002-04-30 05:10:49 +00:00
commit d4da2d9f7d

View file

@ -12,7 +12,7 @@ template <class Chrom> float binary_value(const Chrom& _chrom)
float sum = 0;
for (unsigned i = 0; i < _chrom.size(); i++)
if (_chrom[i])
sum += pow(2, _chrom.size() - i - 1);
sum += _chrom[i];
return sum;
}