?? crossover.m
字號:
function res=crossover(grp,parent,p_cross,numSVM)
%GA crossover function
%The return value refers to postcrossover the group
%The mother refers to the original group
res=zeros(99,numSVM);
for i=1:99
first=parent(i,1);
second=parent(i,2);
if Bernoulli(p_cross)
pos=round(numSVM*rand(1));
while pos==0
pos=round(numSVM*rand(1));
end
res(i,:)=exchange(grp(first,:),grp(second,:),pos);
else
res(i,:)=grp(first,:);
end
end
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -