www.pudn.com > yhzgah_sars.rar > select.m
%选择运算
function NewW=select(NewW,se,gc,gm)
%染色体个数
P=length(NewW);
%确定选择概率
Ps=0.08;
%计算标准分布值
t=Ps/(1-(1-Ps)^P);
%计算染色体的选择概率
N=1:P;
expt=N-1;
p=t*(1-Ps).^expt;
%计算染色体的累计选择概率值
for i=1:P
q(i)=sum(p(1:i));
end
%在[0 1]区间产生按升序排列的随机序列r
for i=1:P
r(i)=rand;
end
r=sort(r);
%对染色体进行选择
fitIn=1;newIn=2;
while newIn<=P
if r(newIn)