From: <sla...@us...> - 2009-04-09 20:43:32
|
Revision: 5683 http://octave.svn.sourceforge.net/octave/?rev=5683&view=rev Author: slackydeb Date: 2009-04-09 20:43:29 +0000 (Thu, 09 Apr 2009) Log Message: ----------- little cleanup; remove crossoversinglepoint function because difficult to mantain and not useful Modified Paths: -------------- trunk/octave-forge/main/ga/inst/__gaoptimset_default_options__.m trunk/octave-forge/main/ga/inst/crossoverscattered.m Removed Paths: ------------- trunk/octave-forge/main/ga/doc/old_stuff/crossoversinglepoint.m Deleted: trunk/octave-forge/main/ga/doc/old_stuff/crossoversinglepoint.m =================================================================== --- trunk/octave-forge/main/ga/doc/old_stuff/crossoversinglepoint.m 2009-04-09 20:21:21 UTC (rev 5682) +++ trunk/octave-forge/main/ga/doc/old_stuff/crossoversinglepoint.m 2009-04-09 20:43:29 UTC (rev 5683) @@ -1,57 +0,0 @@ -## Copyright (C) 2008 Luca Favatella <sla...@gm...> -## -## -## This program is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 2, or (at your option) -## any later version. -## -## This program is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; see the file COPYING. If not, write to the Free -## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -## 02110-1301, USA. - -## -*- texinfo -*- -## @deftypefn{Function File} {@var{xoverKids} =} crossoversinglepoint (@var{parents}, @var{options}, @var{nvars}, @var{FitnessFcn}, @var{unused}, @var{thisPopulation}) -## Combine two individuals, or parents, to form a crossover child. -## -## @seealso{ga, gaoptimset} -## @end deftypefn - -## Author: Luca Favatella <sla...@gm...> -## Version: 5.1.2 - -function xoverKids = \ - crossoversinglepoint (parents, - options, nvars, FitnessFcn, unused, - thisPopulation) - - ## example (nvars == 4) - ## p1 = [varA varB varC varD] - ## p2 = [var1 var2 var3 var4] - ## n = 1 ## integer between 1 and nvars - ## child1 = [varA var2 var3 var4] - p1 = parents(1, 1:nvars); - p2 = parents(2, 1:nvars); - n = randint (1, 1, [1, nvars]); - child1 = horzcat (p1(1, 1:n), - p2(1, n+1:nvars)); - - xoverKids = child1; -endfunction - -%!shared nvars, xoverKids -%! parents = [3.2 -34 51 64.21; 3.2 -34 51 64.21]; -%! options = gaoptimset (); -%! nvars = 4; -%! FitnessFcn = false; ## this parameter is unused in the current implementation -%! unused = false; -%! thisPopulation = false; ## this parameter is unused in the current implementation -%! xoverKids = crossoverscattered (parents, options, nvars, FitnessFcn, unused, thisPopulation); -%!assert (size (xoverKids), [1, nvars]); -%!assert (xoverKids(1, 1:nvars), [3.2 -34 51 64.21]); \ No newline at end of file Modified: trunk/octave-forge/main/ga/inst/__gaoptimset_default_options__.m =================================================================== --- trunk/octave-forge/main/ga/inst/__gaoptimset_default_options__.m 2009-04-09 20:21:21 UTC (rev 5682) +++ trunk/octave-forge/main/ga/inst/__gaoptimset_default_options__.m 2009-04-09 20:43:29 UTC (rev 5683) @@ -1,4 +1,4 @@ -## Copyright (C) 2008 Luca Favatella <sla...@gm...> +## Copyright (C) 2008, 2009 Luca Favatella <sla...@gm...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by Modified: trunk/octave-forge/main/ga/inst/crossoverscattered.m =================================================================== --- trunk/octave-forge/main/ga/inst/crossoverscattered.m 2009-04-09 20:21:21 UTC (rev 5682) +++ trunk/octave-forge/main/ga/inst/crossoverscattered.m 2009-04-09 20:43:29 UTC (rev 5683) @@ -1,4 +1,4 @@ -## Copyright (C) 2008 Luca Favatella <sla...@gm...> +## Copyright (C) 2008, 2009 Luca Favatella <sla...@gm...> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -14,7 +14,7 @@ ## along with this program; If not, see <http://www.gnu.org/licenses/>. ## Author: Luca Favatella <sla...@gm...> -## Version: 6.3.1 +## Version: 6.3.2 function xoverKids = crossoverscattered (parents, options, nvars, FitnessFcn, unused, @@ -24,7 +24,7 @@ ## p1 = [varA varB varC varD] ## p2 = [var1 var2 var3 var4] ## b = [1 1 0 1] - ## child1 = [varA varB var3 varD] + ## child = [varA varB var3 varD] nc_parents = columns (parents); n_children = nc_parents / 2; p1(1:n_children, 1:nvars) = \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |