亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ga.m

?? 用于matlab的遺傳算法工具箱(里面含有遺傳算法所有的操作
?? M
字號:
function [x,endPop,bPop,traceInfo] = ga(bounds,evalFN,evalOps,startPop,opts,...                                        termFN,termOps,selectFN,selectOps,xOverFNs,...                                        xOverOps,mutFNs,mutOps)% GA run a genetic algorithm% function [x,endPop,bPop,traceInfo]=ga(bounds,evalFN,evalOps,startPop,opts,%                                       termFN,termOps,selectFN,selectOps,%                                       xOverFNs,xOverOps,mutFNs,mutOps)%                                % Output Arguments:%   x            - the best solution found during the course of the run%   endPop       - the final population %   bPop         - a trace of the best population%   traceInfo    - a matrix of best and means of the ga for each generation%% Input Arguments:%   bounds       - a matrix of upper and lower bounds on the variables%   evalFN       - the name of the evaluation .m function%   evalOps      - options to pass to the evaluation function ([NULL])%   startPop     - a matrix of solutions that can be initialized%                  from initialize.m%   opts         - [epsilon prob_ops display] change required to consider two %                  solutions different, prob_ops 0 if you want to apply the%                  genetic operators probabilisticly to each solution, 1 if%                  you are supplying a deterministic number of operator%                  applications and display is 1 to output progress 0 for%                  quiet. ([1e-6 1 0])%   termFN       - name of the .m termination function (['maxGenTerm'])%   termOps      - options string to be passed to the termination function%                  ([100]).%   selectFN     - name of the .m selection function (['normGeomSelect'])%   selectOpts   - options string to be passed to select after%                  select(pop,#,opts) ([0.08])%   xOverFNS     - a string containing blank seperated names of Xover.m%                  files (['arithXover heuristicXover simpleXover']) %   xOverOps     - A matrix of options to pass to Xover.m files with the%                  first column being the number of that xOver to perform%                  similiarly for mutation ([2 0;2 3;2 0])%   mutFNs       - a string containing blank seperated names of mutation.m %                  files (['boundaryMutation multiNonUnifMutation ...%                           nonUnifMutation unifMutation'])%   mutOps       - A matrix of options to pass to Xover.m files with the%                  first column being the number of that xOver to perform%                  similiarly for mutation ([4 0 0;6 100 3;4 100 3;4 0 0])% Binary and Real-Valued Simulation Evolution for Matlab % Copyright (C) 1996 C.R. Houck, J.A. Joines, M.G. Kay %% C.R. Houck, J.Joines, and M.Kay. A genetic algorithm for function% optimization: A Matlab implementation. ACM Transactions on Mathmatical% Software, Submitted 1996.%% 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 1, 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. A copy of the GNU % General Public License can be obtained from the % Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.%%$Log: ga.m,v $%Revision 1.10  1996/02/02  15:03:00  jjoine% Fixed the ordering of imput arguments in the comments to match% the actual order in the ga function.%%Revision 1.9  1995/08/28  20:01:07  chouck% Updated initialization parameters, updated mutation parameters to reflect% b being the third option to the nonuniform mutations%%Revision 1.8  1995/08/10  12:59:49  jjoine%Started Logfile to keep track of revisions%n=nargin;if n<2 | n==6 | n==10 | n==12  disp('Insufficient arguements') endif n<3 %Default evalation opts.  evalOps=[];endif n<5  opts = [1e-6 1 0];endif isempty(opts)  opts = [1e-6 1 0];endif any(evalFN<48) %Not using a .m file  if opts(2)==1 %Float ga    e1str=['x=c1; c1(xZomeLength)=', evalFN ';'];      e2str=['x=c2; c2(xZomeLength)=', evalFN ';'];    else %Binary ga    e1str=['x=b2f(endPop(j,:),bounds,bits); endPop(j,xZomeLength)=',...	evalFN ';'];  endelse %Are using a .m file  if opts(2)==1 %Float ga    e1str=['[c1 c1(xZomeLength)]=' evalFN '(c1,[gen evalOps]);'];      e2str=['[c2 c2(xZomeLength)]=' evalFN '(c2,[gen evalOps]);'];    else %Binary ga    e1str=['x=b2f(endPop(j,:),bounds,bits);[x v]=' evalFN ...	'(x,[gen evalOps]); endPop(j,:)=[f2b(x,bounds,bits) v];'];    endendif n<6 %Default termination information  termOps=[100];  termFN='maxGenTerm';endif n<12 %Default muatation information  if opts(2)==1 %Float GA    mutFNs=['boundaryMutation multiNonUnifMutation nonUnifMutation unifMutation'];    mutOps=[4 0 0;6 termOps(1) 3;4 termOps(1) 3;4 0 0];  else %Binary GA    mutFNs=['binaryMutation'];    mutOps=[0.05];  endendif n<10 %Default crossover information  if opts(2)==1 %Float GA    xOverFNs=['arithXover heuristicXover simpleXover'];    xOverOps=[2 0;2 3;2 0];  else %Binary GA    xOverFNs=['simpleXover'];    xOverOps=[0.6];  endendif n<9 %Default select opts only i.e. roullete wheel.  selectOps=[];endif n<8 %Default select info  selectFN=['normGeomSelect'];  selectOps=[0.08];endif n<6 %Default termination information  termOps=[100];  termFN='maxGenTerm';endif n<4 %No starting population passed given  startPop=[];endif isempty(startPop) %Generate a population at random  %startPop=zeros(80,size(bounds,1)+1);  startPop=initializega(80,bounds,evalFN,evalOps,opts(1:2));endif opts(2)==0 %binary  bits=calcbits(bounds,opts(1));endxOverFNs=parse(xOverFNs);mutFNs=parse(mutFNs);xZomeLength  = size(startPop,2); 	%Length of the xzome=numVars+fittnessnumVar       = xZomeLength-1; 		%Number of variablespopSize      = size(startPop,1); 	%Number of individuals in the popendPop       = zeros(popSize,xZomeLength); %A secondary population matrixc1           = zeros(1,xZomeLength); 	%An individualc2           = zeros(1,xZomeLength); 	%An individualnumXOvers    = size(xOverFNs,1); 	%Number of Crossover operatorsnumMuts      = size(mutFNs,1); 		%Number of Mutation operatorsepsilon      = opts(1);                 %Threshold for two fittness to differoval         = max(startPop(:,xZomeLength)); %Best value in start popbFoundIn     = 1; 			%Number of times best has changeddone         = 0;                       %Done with simulated evolutiongen          = 1; 			%Current Generation NumbercollectTrace = (nargout>3); 		%Should we collect info every genfloatGA      = opts(2)==1;              %Probabilistic application of opsdisplay      = opts(3);                 %Display progress while(~done)  %Elitist Model  [bval,bindx] = max(startPop(:,xZomeLength)); %Best of current pop  best =  startPop(bindx,:);  if collectTrace    traceInfo(gen,1)=gen; 		          %current generation    traceInfo(gen,2)=startPop(bindx,xZomeLength);       %Best fittness    traceInfo(gen,3)=mean(startPop(:,xZomeLength));     %Avg fittness    traceInfo(gen,4)=std(startPop(:,xZomeLength));   end    if ( (abs(bval - oval)>epsilon) | (gen==1)) %If we have a new best sol    if display      fprintf(1,'\n%d %f\n',gen,bval);          %Update the display    end    if floatGA      bPop(bFoundIn,:)=[gen startPop(bindx,:)]; %Update bPop Matrix    else      bPop(bFoundIn,:)=[gen b2f(startPop(bindx,1:numVar),bounds,bits)...	                    startPop(bindx,xZomeLength)];    end    bFoundIn=bFoundIn+1;                      %Update number of changes    oval=bval;                                %Update the best val  else    if display      fprintf(1,'%d ',gen);	              %Otherwise just update num gen    end  end    endPop = feval(selectFN,startPop,[gen selectOps]); %Select    if floatGA %Running with the model where the parameters are numbers of ops    for i=1:numXOvers,      for j=1:xOverOps(i,1),	      a = round(rand*(popSize-1)+1); 	%Pick a parent	      b = round(rand*(popSize-1)+1); 	%Pick another parent	      xN=deblank(xOverFNs(i,:)); 	%Get the name of crossover function	      [c1 c2] = feval(xN,endPop(a,:),endPop(b,:),bounds,[gen xOverOps(i,:)]);		     if c1(1:numVar)==endPop(a,(1:numVar)) %Make sure we created a new 	        c1(xZomeLength)=endPop(a,xZomeLength); %solution before evaluating	     elseif c1(1:numVar)==endPop(b,(1:numVar))	            c1(xZomeLength)=endPop(b,xZomeLength);	         else 	          %[c1(xZomeLength) c1] = feval(evalFN,c1,[gen evalOps]);	            eval(e1str);	        end	     if c2(1:numVar)==endPop(a,(1:numVar))	        c2(xZomeLength)=endPop(a,xZomeLength);	     elseif c2(1:numVar)==endPop(b,(1:numVar))	            c2(xZomeLength)=endPop(b,xZomeLength);	         else 	         %[c2(xZomeLength) c2] = feval(evalFN,c2,[gen evalOps]);	            eval(e2str);	         end      		     endPop(a,:)=c1;	     endPop(b,:)=c2;        end     end       for i=1:numMuts,        for j=1:mutOps(i,1),	        a = round(rand*(popSize-1)+1);	        c1 = feval(deblank(mutFNs(i,:)),endPop(a,:),bounds,[gen mutOps(i,:)]);	        if c1(1:numVar)==endPop(a,(1:numVar)) 	           c1(xZomeLength)=endPop(a,xZomeLength);	        else	        %[c1(xZomeLength) c1] = feval(evalFN,c1,[gen evalOps]);	           eval(e1str);	        end	        endPop(a,:)=c1;        end    end      else %We are running a probabilistic model of genetic operators    for i=1:numXOvers,       xN=deblank(xOverFNs(i,:)); 	%Get the name of crossover function       cp=find(rand(popSize,1)<xOverOps(i,1)==1);       if rem(size(cp,1),2)            cp=cp(1:(size(cp,1)-1));        end       cp=reshape(cp,size(cp,1)/2,2);       for j=1:size(cp,1)	      a=cp(j,1);          b=cp(j,2); 	      [endPop(a,:) endPop(b,:)] = feval(xN,endPop(a,:),endPop(b,:),...	                                        bounds,[gen xOverOps(i,:)]);      end   end   for i=1:numMuts      mN=deblank(mutFNs(i,:));      for j=1:popSize	     endPop(j,:) = feval(mN,endPop(j,:),bounds,[gen mutOps(i,:)]);	     eval(e1str);      end  end  end    gen=gen+1;  done=feval(termFN,[gen termOps],bPop,endPop); %See if the ga is done  startPop=endPop; 			%Swap the populations    [bval,bindx] = min(startPop(:,xZomeLength)); %Keep the best solution  startPop(bindx,:) = best; 		%replace it with the worstend[bval,bindx] = max(startPop(:,xZomeLength));if display   fprintf(1,'\n%d %f\n',gen,bval);	  endx=startPop(bindx,:);if opts(2)==0 %binary  x=b2f(x,bounds,bits);  bPop(bFoundIn,:)=[gen b2f(startPop(bindx,1:numVar),bounds,bits)...      startPop(bindx,xZomeLength)];else  bPop(bFoundIn,:)=[gen startPop(bindx,:)];endif collectTrace  traceInfo(gen,1)=gen; 		%current generation  traceInfo(gen,2)=startPop(bindx,xZomeLength); %Best fittness  traceInfo(gen,3)=mean(startPop(:,xZomeLength)); %Avg fittnessend

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产亚洲一二三区| 国内久久婷婷综合| 成人黄色片在线观看| 日韩写真欧美这视频| 国产精品久久久久久久浪潮网站| 韩国av一区二区三区四区| 在线播放国产精品二区一二区四区| 亚洲视频狠狠干| 国产不卡视频在线观看| 欧美国产精品专区| 韩国三级电影一区二区| 久久久久久久久久电影| 国产一区二区三区在线观看精品| 91精品办公室少妇高潮对白| 亚洲激情在线播放| 91国在线观看| 亚洲va在线va天堂| 精品国产一区二区三区久久久蜜月 | 亚洲.国产.中文慕字在线| 亚洲成av人片www| 精品国产sm最大网站免费看| 国产在线精品一区二区三区不卡 | 91在线精品一区二区三区| 亚洲欧美日韩久久精品| 在线中文字幕不卡| 久久精品二区亚洲w码| 26uuu亚洲综合色| 91亚洲大成网污www| 亚洲激情自拍视频| 久久免费看少妇高潮| 一本一本久久a久久精品综合麻豆| 午夜久久久影院| 久久影院视频免费| 蜜桃视频一区二区三区| 337p日本欧洲亚洲大胆色噜噜| 丁香一区二区三区| 亚洲欧美综合色| 亚洲精品成a人| 91精品国产91久久久久久最新毛片| 国产精品白丝av| 亚洲激情自拍视频| 日韩欧美久久久| 欧美三级视频在线播放| 成人丝袜视频网| 国产精品一区二区你懂的| 亚州成人在线电影| 亚洲欧美日韩国产手机在线| 国产婷婷精品av在线| 欧美哺乳videos| 精品日韩一区二区| 欧美一级欧美三级| 日韩亚洲欧美在线| 日韩欧美国产一区在线观看| 欧美高清www午色夜在线视频| 在线视频中文字幕一区二区| 91丨国产丨九色丨pron| aa级大片欧美| 一本色道综合亚洲| 欧美日韩视频在线观看一区二区三区| 一本色道久久综合精品竹菊| 99v久久综合狠狠综合久久| 91浏览器在线视频| 色久优优欧美色久优优| 欧美艳星brazzers| 欧美三片在线视频观看| 日韩欧美中文字幕公布| 欧美变态凌虐bdsm| 国产精品高潮呻吟| 亚洲第一成人在线| 国模无码大尺度一区二区三区| 国产成人av资源| 在线观看三级视频欧美| 欧美日韩激情一区二区三区| 亚洲一线二线三线久久久| 首页综合国产亚洲丝袜| 久久精品国产久精国产| 91在线视频网址| 日韩精品资源二区在线| 亚洲精品免费在线| 韩国毛片一区二区三区| 欧美日韩一卡二卡三卡| 国产精品久久久久久久久果冻传媒| 亚洲激情网站免费观看| 国产一区二区三区四| 欧美日韩在线播放一区| 欧美国产一区在线| 美女视频第一区二区三区免费观看网站| 国产福利视频一区二区三区| 欧美精品久久99| 有码一区二区三区| 99精品欧美一区二区三区小说| 欧美一区二区女人| 亚洲一区二区三区四区在线免费观看| 国产综合久久久久久鬼色| 成人深夜视频在线观看| 久久视频一区二区| 日韩av二区在线播放| 欧美日韩国产高清一区| 一区二区三区资源| 日本道色综合久久| 亚洲黄色免费网站| 色综合网色综合| 一区二区三区在线影院| 色婷婷综合久久久久中文一区二区 | 国产激情91久久精品导航| 日韩欧美高清一区| 久久精品国产99国产| 制服丝袜中文字幕一区| 性欧美疯狂xxxxbbbb| 日韩欧美国产午夜精品| 免费人成在线不卡| 久久蜜桃av一区精品变态类天堂| 日本不卡在线视频| 国产日产欧美一区二区三区| 国产成人午夜精品影院观看视频| 中文乱码免费一区二区| 色呦呦国产精品| 日韩经典一区二区| 久久久久久久久久久久电影| 成人免费高清视频| 亚洲福利一区二区三区| 精品免费国产一区二区三区四区| 色婷婷综合五月| 国产精品一级片在线观看| 亚洲免费资源在线播放| 制服丝袜亚洲精品中文字幕| 韩国v欧美v亚洲v日本v| 亚洲黄网站在线观看| 日韩精品一区二区三区视频播放| 丁香六月综合激情| 五月天精品一区二区三区| 国产精品国产三级国产aⅴ原创| 欧美日韩国产精品自在自线| 成人h动漫精品| 国内精品久久久久影院薰衣草| 亚洲精品自拍动漫在线| 精品国产一区二区三区久久久蜜月| 欧洲日韩一区二区三区| 风间由美中文字幕在线看视频国产欧美| 亚洲精品国产高清久久伦理二区| 日韩欧美另类在线| 欧美电影在哪看比较好| 在线观看国产日韩| 9l国产精品久久久久麻豆| 国产一区在线观看麻豆| 老司机免费视频一区二区| 亚洲成人av免费| 亚洲综合自拍偷拍| 一二三四社区欧美黄| 亚洲欧洲另类国产综合| 国产精品成人在线观看| 久久精品一区四区| 亚洲美女屁股眼交| 日韩一区在线看| 国产精品福利影院| 一区二区三区精品久久久| 亚洲精选在线视频| 丝袜美腿亚洲综合| 麻豆精品国产传媒mv男同| 麻豆精品视频在线观看| 国产精品羞羞答答xxdd| 国产99精品国产| 在线视频国内一区二区| 欧美人狂配大交3d怪物一区| 日韩三级视频在线看| 久久九九影视网| 亚洲人成小说网站色在线| 一区二区三区欧美激情| 天堂成人国产精品一区| 黄网站免费久久| 日本乱人伦一区| 精品日韩av一区二区| 国产精品国产三级国产有无不卡 | 国产精品自拍三区| 成人av电影免费在线播放| 欧美日韩一区二区在线视频| 精品免费视频一区二区| 亚洲日本乱码在线观看| 日韩激情av在线| 色综合久久综合网欧美综合网| 欧美在线看片a免费观看| 亚洲国产精品99久久久久久久久| 成人涩涩免费视频| 91色在线porny| 精品国产青草久久久久福利| 亚洲午夜激情网站| 成人ar影院免费观看视频| 精品少妇一区二区三区在线播放 | 国产欧美一区二区三区网站| 婷婷综合在线观看| 在线一区二区三区四区五区| 国产欧美1区2区3区| 国产精品99久久久久久似苏梦涵| 欧美高清一级片在线| 亚洲bdsm女犯bdsm网站| 欧美在线一二三四区| 亚洲精品成人少妇| 91成人免费网站| 日日摸夜夜添夜夜添亚洲女人| 色婷婷一区二区三区四区|