From: <sla...@us...> - 2012-03-23 01:59:44
|
Revision: 10018 http://octave.svn.sourceforge.net/octave/?rev=10018&view=rev Author: slackydeb Date: 2012-03-23 01:59:38 +0000 (Fri, 23 Mar 2012) Log Message: ----------- ga: add unit test in ga Modified Paths: -------------- trunk/octave-forge/main/ga/inst/ga.m Modified: trunk/octave-forge/main/ga/inst/ga.m =================================================================== --- trunk/octave-forge/main/ga/inst/ga.m 2012-03-23 01:59:26 UTC (rev 10017) +++ trunk/octave-forge/main/ga/inst/ga.m 2012-03-23 01:59:38 UTC (rev 10018) @@ -265,13 +265,17 @@ %! x = ga (f, nvars, [], [], [], [], [], [], @nonlcon, options); ## error with conflicting optimization parameters -# TODO: Elite count cannot be greater than the population size %!shared f, nvars %! f = @rastriginsfcn; %! nvars = 2; %!function [C, Ceq] = nonlcon (x) %! C = []; %! Ceq = []; +%!error # Elite count cannot be greater than the population size +%! ps = 3; +%! bad_options = gaoptimset ("PopulationSize", ps, +%! "EliteCount", ps + 1); +%! x = ga (f, nvars, [], [], [], [], [], [], @nonlcon, bad_options); %!error # The number of individuals in the initial population cannot be greater of the population size %! ps = 3; %! bad_options = gaoptimset ("PopulationSize", ps, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |