1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
Description: Avoid random failure in unit test of ga.m
Apparently, EliteCount must be strictly smaller than PopulationSize,
but the root of the bug may be elsewhere.
Author: Rafael Laboissiere <rafael@debian.org>
Forwarded: https://savannah.gnu.org/bugs/index.php?55348
Last-Update: 2018-12-31
--- octave-ga-0.10.0.orig/inst/ga.m
+++ octave-ga-0.10.0/inst/ga.m
@@ -196,7 +196,7 @@ endfunction
%! x = ga (f, nvars, [], [], [], [], [], [], @nonlcon, options);
%!test
%! ps = getfield (default_options, "PopulationSize");
-%! options = gaoptimset ("EliteCount", randi ([0, ps]));
+%! options = gaoptimset ("EliteCount", randi ([0, ps - 1]));
%! x = ga (f, nvars, [], [], [], [], [], [], @nonlcon, options);
%!test
%! options = gaoptimset ("FitnessLimit", 1e-7);
|