📄 mutation1.m
字号:
function v1=mutation1(c1,k,population,a)
%变异算子,前0.02,中0.03,后0.02
if k<=30
pm=0.02;
elseif k>30 & k<=50
pm=0.03;
else
pm=0.02;
end
child=c1;
for i=1:population
point=round(rand(1)*(a-1));
tempP=rand(1);
if(tempP<pm)
child(i,:)=point;
end
end
v1=child;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -