?? cross.m
字號:
function c1=cross(s_code1)
%交叉算子
pc=0.8; %交叉概率取0.6
population=10;
%(1,2)/(3,4)/(5,6)進行交叉運算,(7,8)/(9,10)復制
ww=s_code1;
for i=1:(pc*population/2)
r=abs(round(rand(1)*10)-3);
for j=(r+1):8
temp=ww(2*i-1,j);
ww(2*i-1,j)=ww(2*i,j);
ww(2*i,j)=temp;
end
end
c1=ww;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -