資源簡介
可以實(shí)現(xiàn)一維自變量的線性規(guī)劃問題,二維也可以實(shí)現(xiàn),只是有區(qū)域?qū)?yōu)現(xiàn)象;

代碼片段和文件信息
%%交叉函數(shù)%%
function?scro=crossover(populationselnpc)
bitlength=size(population2);%計(jì)算二進(jìn)制初始種群的長度
pcc=ifcroifmut(pc);%%按照交叉概率去得到一個(gè)值為0或1的數(shù)
if?pcc==1?%%交叉計(jì)算
???chb=round(rand*(bitlength-2))+1;
???scro(1:)=[population(seln(1)1:chb)?population(seln(2)chb+1:bitlength)];
???scro(2:)=[population(seln(2)1:chb)?population(seln(1)chb+1:bitlength)];
else????%%直接遺傳
???scro(1:)=population(seln(1):);
???scro(2:)=population(seln(2):);
end
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????486??2017-08-23?19:02??ga101\crossover.m
?????文件????????891??2017-08-23?18:35??ga101\fitnessfun.m
?????文件???????1057??2017-08-25?14:50??ga101\fitnessfun2.m
?????文件???????2855??2017-08-25?14:48??ga101\GA101.m
?????文件???????2720??2017-08-23?19:45??ga101\ga110.m
?????文件???????2247??2017-08-25?14:45??ga101\GA_hanshu.m
?????文件????????298??2017-08-23?19:00??ga101\ifcroifmut.m
?????文件????????209??2017-08-23?18:51??ga101\mutation.m
?????文件????????228??2017-08-23?18:51??ga101\selection.m
?????文件?????????78??2017-08-23?17:06??ga101\targetfun.m
?????文件????????151??2017-08-25?14:50??ga101\targetfun2.m
?????文件????????226??2017-08-23?19:25??ga101\transform2to10.m
?????目錄??????????0??2017-08-25?15:09??ga100
?????目錄??????????0??2017-08-25?15:09??ga101
-----------?---------??----------?-----??----
????????????????11446????????????????????14
評(píng)論
共有 條評(píng)論