資源簡介
popsize=5; %群體大小
global chromlength;
chromlength=20;%字符串長度
pc=0.5;%交叉概率
pm=0.05;%變異概率
Max_Itet=100;
pop=initpop(popsize,chromlength);%隨機產生初始群體
代碼片段和文件信息
%求出群體中適應值最大的值
function?[bestindividualbestfit]=best(popfitvalue)
[pxpy]=size(pop);
bestindividual=pop(1:);
bestfit=fitvalue(1);
for?i=2:px
????if?fitvalue(i)>bestfit
????????bestindividual=pop(i:);
????????bestfit=fitvalue(i);
????end
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-11-09?08:37??ga算法\
?????文件?????????267??2018-09-26?14:36??ga算法\best.m
?????文件?????????256??2018-09-26?14:11??ga算法\calfitvalue.m
?????文件?????????198??2018-09-26?14:06??ga算法\calobjvalue.m
?????文件?????????362??2018-09-26?14:25??ga算法\crossover.m
?????文件?????????302??2018-09-26?14:56??ga算法\decodechrom.m
?????文件?????????113??2018-09-26?15:12??ga算法\f_sinc.m
?????文件?????????212??2018-09-26?13:54??ga算法\initpop.m
?????文件????????1123??2018-11-02?09:58??ga算法\main.m
?????文件?????????413??2018-09-26?14:31??ga算法\mutation.m
?????文件?????????457??2018-09-26?15:14??ga算法\selection.m
- 上一篇:AD9953論文
- 下一篇:wifi驅動.zip
評論
共有 條評論