From: <sla...@us...> - 2012-03-15 02:27:49
|
Revision: 9901 http://octave.svn.sourceforge.net/octave/?rev=9901&view=rev Author: slackydeb Date: 2012-03-15 02:27:43 +0000 (Thu, 15 Mar 2012) Log Message: ----------- ga: comment all demos-yet-tests in demo_ga Avoid people complaining about the unit test suit after running "test demo_ga" instead of executing "test_ga". Modified Paths: -------------- trunk/octave-forge/main/ga/inst/demo_ga.m Modified: trunk/octave-forge/main/ga/inst/demo_ga.m =================================================================== --- trunk/octave-forge/main/ga/inst/demo_ga.m 2012-03-15 02:24:25 UTC (rev 9900) +++ trunk/octave-forge/main/ga/inst/demo_ga.m 2012-03-15 02:27:43 UTC (rev 9901) @@ -32,30 +32,30 @@ ## This code is a simple example of the usage of ga # TODO: convert to demo -%!xtest assert (ga (@rastriginsfcn, 2), [0, 0], 1e-3) +# %!xtest assert (ga (@rastriginsfcn, 2), [0, 0], 1e-3) ## This code shows that ga optimizes also functions whose minimum is not ## in zero # TODO: convert to demo -%!xtest -%! min = [-1, 2]; -%! assert (ga (struct ("fitnessfcn", @(x) rastriginsfcn (x - min), "nvars", 2, "options", gaoptimset ("FitnessLimit", 1e-7, "Generations", 1000, "PopInitRange", [-5; 5], "PopulationSize", 200))), min, 1e-5) +# %!xtest +# %! min = [-1, 2]; +# %! assert (ga (struct ("fitnessfcn", @(x) rastriginsfcn (x - min), "nvars", 2, "options", gaoptimset ("FitnessLimit", 1e-7, "Generations", 1000, "PopInitRange", [-5; 5], "PopulationSize", 200))), min, 1e-5) ## This code shows that the "Vectorize" option usually speeds up execution # TODO: convert to demo -%!test -%! -%! tic (); -%! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200))); -%! elapsed_time = toc (); -%! -%! tic (); -%! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200, "Vectorized", "on"))); -%! elapsed_time_with_vectorized = toc (); -%! -%! assert (elapsed_time > elapsed_time_with_vectorized); +# %!test +# %! +# %! tic (); +# %! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200))); +# %! elapsed_time = toc (); +# %! +# %! tic (); +# %! ga (struct ("fitnessfcn", @rastriginsfcn, "nvars", 2, "options", gaoptimset ("Generations", 10, "PopulationSize", 200, "Vectorized", "on"))); +# %! elapsed_time_with_vectorized = toc (); +# %! +# %! assert (elapsed_time > elapsed_time_with_vectorized); ## The "UseParallel" option should speed up execution # TODO: write demo (after implementing This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sla...@us...> - 2012-03-19 00:41:07
|
Revision: 9960 http://octave.svn.sourceforge.net/octave/?rev=9960&view=rev Author: slackydeb Date: 2012-03-19 00:41:01 +0000 (Mon, 19 Mar 2012) Log Message: ----------- ga: fix dummy demo Modified Paths: -------------- trunk/octave-forge/main/ga/inst/demo_ga.m Modified: trunk/octave-forge/main/ga/inst/demo_ga.m =================================================================== --- trunk/octave-forge/main/ga/inst/demo_ga.m 2012-03-19 00:34:25 UTC (rev 9959) +++ trunk/octave-forge/main/ga/inst/demo_ga.m 2012-03-19 00:41:01 UTC (rev 9960) @@ -21,9 +21,9 @@ ## Author: Luca Favatella <sla...@gm...> ## Created: March 2012 -## Version: 0.0.3 +## Version: 0.0.4 -demo ga_demo +demo demo_ga %!demo This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |