資源簡(jiǎn)介
matlab目標(biāo)函數(shù)中a b c z以及下式中的a b c z與A是對(duì)應(yīng)的關(guān)系,需要實(shí)現(xiàn)EXCEL表導(dǎo)入進(jìn)行批量運(yùn)算
2、B C D..........以及B丿,C丿,D丿......為固定值,輸入一次即可(即批量運(yùn)算時(shí)這些值不變)
代碼片段和文件信息
%%?交叉函數(shù)
function?populnew?=?crossover(populpcronlengthdim)
%%?pcro為交叉概率
k?=?1;
j?=?0;
while(k ????rk?=?rand();
????if?rk ????????b(j+1)?=?k;
????????j?=?j+1;
????end
????k?=?k+1;
????if?j==2
????????pos?=?fix(rand()*dim*length)+1;??????%%隨機(jī)產(chǎn)生交叉點(diǎn)fix為向0取整
????????for?l?=?1:dim
????????????for?i?=?pos:l*length
????????????????c?=?popul(b(1)i);
????????????????popul(b(1)i)?=?popul(b(2)i);??%%對(duì)交叉點(diǎn)之后的編碼進(jìn)行交換
????????????????popul(b(2)i)?=?c;
????????????end
????????????pos?=?pos+length;
????????end
????????j?=?0;
????end
end
populnew?=?popul;
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件??????11214??2017-06-01?09:32??GA\14941.xlsx
?????文件??????10621??2017-06-01?09:32??GA\bianhua.xlsx
?????文件????????616??2015-01-31?14:10??GA\crossover.m
?????文件???????1372??2017-06-05?13:11??GA\Formulationf.m
?????文件???????1281??2017-06-05?13:12??GA\FormulationR.m
?????文件???????1980??2017-06-01?10:06??GA\GA1.m
?????文件???????9894??2017-06-07?22:00??GA\guding.xlsx
?????文件???????1468??2017-06-07?21:06??GA\main.m
?????文件????????414??2015-01-31?12:22??GA\mutation.m
?????文件????????453??2015-01-29?22:58??GA\select.m
?????文件???????4680??2017-09-20?16:42??GA\unti
?????文件???????4178??2017-09-20?16:42??GA\unti
?????目錄??????????0??2017-09-20?16:42??GA
-----------?---------??----------?-----??----
????????????????48171????????????????????13
評(píng)論
共有 條評(píng)論