查看单个帖子
旧 2009-03-30, 11:17   #1
jiandan
初级会员
 
注册日期: 2009-03-23
年龄: 39
帖子: 6
声望力: 0
jiandan 正向着好的方向发展
默认 [求助]遗传算法代码疑难

%将30个变量分为五个范围,相临两个染色体分别从五位进行交叉
crb1=round(rand*(bn/5-1))+1; %在[1,6]范围内随机产生一个交叉位
cross(i,crb1:crb1)=0.1*select(i,crb1:crb1)+0.9*select(i+1,crb1:crb1);
cross(i+1,crb1:crb1)=0.1*select(i,crb1:crb1)+0.9*select(i+1,crb1:crb1);
cross(i,2*crb1:2*crb1)=0.1*select(i,2*crb1:2*crb1)+0.9*select(i+1,2*crb1:2*crb1);
cross(i+1,2*crb1:2*crb1)=0.1*select(i,2*crb1:2*crb1)+0.9*select(i+1,2*crb1:2*crb1);
cross(i,3*crb1:3*crb1)=0.1*select(i,3*crb1:3*crb1)+0.9*select(i+1,3*crb1:3*crb1);
cross(i+1,3*crb1:3*crb1)=0.1*select(i,3*crb1:3*crb1)+0.9*select(i+1,3*crb1:3*crb1);
cross(i,4*crb1:4*crb1)=0.1*select(i,4*crb1:4*crb1)+0.9*select(i+1,4*crb1:4*crb1);
cross(i+1,4*crb1:4*crb1)=0.1*select(i,4*crb1:4*crb1)+0.9*select(i+1,4*crb1:4*crb1);
cross(i,5*crb1:5*crb1)=0.1*select(i,5*crb1:5*crb1)+0.9*select(i+1,5*crb1:5*crb1);
cross(i+1,5*crb1:5*crb1)=0.1*select(i,5*crb1:5*crb1)+0.9*select(i+1,5*crb1:5*crb1);
end
上面是遗传算法用MATLAB编写的程序,我想问一下它是怎么来的,特别是那个0.1、0.9是什么?
jiandan 当前离线   回复时引用此帖