Matlab遗传算法学习-reclin
来源:互联网 发布:xapmm 设置域名重定向 编辑:程序博客网 时间:2024/06/11 23:14
中间重组与线性重组相似,然而recint对没对值使用了一新的Alpha值一起重组,而reclin对每队双亲使用一Alpha因子。
function NewChrom = reclin(OldChrom, XOVR); % Identify the population size (Nind) and the number of variables (Nvar) [Nind,Nvar] = size(OldChrom); % Identify the number of matings Xops = floor(Nind/2);% 向左取整 % Performs recombination odd = 1:2:Nind-1;% 冒号运算符可以指定增量步长值,(first:step:last),1:2:Nind-1将产生1,3,5等等 even= 2:2:Nind; % position of value of offspring compared to parents Alpha = -0.25 + 1.5 * rand(Xops,1);%rand生成0~1之间均匀分布的随机数 Alpha = Alpha(1:Xops,ones(Nvar,1));%ones创建m*n的全1矩阵,%每列的Alpha值相同相当于,复制Nvar个Alpha %交配的对是有序的,奇数行与它下一个偶行配对。 % recombination NewChrom(odd,:) = OldChrom(odd,:) + Alpha .* (OldChrom(even,:) - OldChrom(odd,:)); % the same ones more for second half of offspring Alpha = -0.25 + 1.5 * rand(Xops,1); Alpha = Alpha(1:Xops,ones(Nvar,1)); NewChrom(even,:) = OldChrom(odd,:) + Alpha .* (OldChrom(even,:) - OldChrom(odd,:)); %最后一个奇数行不参与交配,直接加入到NewChrom的末尾 %余项函数,取余rem(10,3)=1 % If the number of individuals is odd, the last individual cannot be mated% but must be included in the new population if rem(Nind,2), NewChrom(Nind,:)=OldChrom(Nind,:); end % End of function
阅读全文
0 0
- Matlab遗传算法学习-reclin
- Matlab遗传算法学习-recint.m
- matlab遗传算法
- MATLAB-遗传算法
- Matlab实现遗传算法
- MATLAB遗传算法实例
- 遗传算法MATLAB
- 遗传算法MATLAB
- 遗传算法MATLAB
- 一个matlab遗传算法源程序
- Matlab遗传算法(一)
- matlab遗传算法工具箱(GADs)
- MATLAB遗传算法函数总结
- 简单遗传算法MATLAB实现
- 遗传算法matlab仿真实例
- Matlab遗传算法性能测试
- 简单遗传算法MATLAB实现
- 遗传算法的matlab实现
- servlet的url-pattern匹配规则详细描述 一、概述 在利用servlet或Filter进行url请求的匹配时,很关键的一点就是匹配规则,但servlet容器中的匹配规则既不是简单的通
- Matlab遗传算法学习-recint.m
- 广电电视信号如何生成RTMP流进入流媒体系统网络分发实现手机APP播放
- 微信支付开发相关及测试[未完]
- 从程序员到项目经理
- Matlab遗传算法学习-reclin
- NZAU 1203: One Stroke 树上二分前缀和
- C++ 虚函数表解析
- SIP 中的Dialog,call,session 和 transaction
- 移动端adaptive设置
- javac: file not found
- 排序算法实践编程之——快排法
- elasticSearch深度剖析之集群升级规范操作步骤
- SPOJ 8073 CIRU