Subject: | Fencepost error in RangeVector individuals |
When using individuals of type RangeVector, their genes can never read the specified maximum of the range. This is because of a bug in IndRangeVector.pm. Line 21 should be changed from
my $rand = $r->[0] + int rand($r->[1] - $r->[0]);
to
my $rand = $r->[0] + int rand($r->[1] - $r->[0] + 1);
Explanation: rand(5) will generate numbers between 0 and 5, ie. numbers from 0 up to 4.999999... . int() will cut off these numbers, _not_round them.