针对引力搜索算法存在的易早熟收敛、易陷入局部最优、搜索精度有待提高等缺陷,提出一种混合方法优化的自适应引力搜索算法(gravitationalsearchalgorithm,GSA)。首先 利 用 Sobol序列初始化种群,增强 算法全局搜索能力;其次引入 Hamming贴进度计算种群成熟度,判断种群是否早熟;然后引入 Logistic混沌对种群作混沌搜索,变异已陷入局部最优的粒子位置;最后基于早熟收敛判断因子改进引力系数,并为粒子位置公式添加收缩因子,促使种群加快脱离局部最优。对9个不同类型的基准测试函数做仿真实验,结果表明新算法能有效改善种群的早熟问题,具备更好的寻优性能。
%_________________________________________________________________________%
% GSA + chaotic gravitational constant %
clear all
P_no=30;
Max_iteration=500;
Run_no=2;
ElitistCheck=1;
All_Convergence_curves=zeros(2,Max_iteration);
chValue=20;
F_index = 1;
for Algorithm_num=1:11
for i=1:Run_no
if Algorithm_num==1
cg_curve=GSA(F_index,P_no,Max_iteration,ElitistCheck,Algorithm_num,chValue);
end
if Algorithm_num==2
cg_curve=GSA(F_index,P_no,Max_iteration,ElitistCheck,Algorithm_num,chValue);
end
if Algorithm_num==3
cg_curve=GSA(F_index,P_no,Max_iteration,ElitistCheck,Algorithm_num,chValue);
end
if Algorithm_num==4
cg_curve=GSA(F_index,P_no,Max_iteration,ElitistCheck,Algorithm_num,chValue);
end
if Algorithm_num==5
cg_curve=GSA(F_index,P_no,Max_iteration,ElitistCheck,Algorithm_num,chValue);
end
if Algorithm_num==6
cg_curve=GSA(F_index,P_no,Max_iteration,ElitistCheck,Algorithm_num,chValue);
end
if Algorithm_num==7
cg_curve=GSA(F_index,P_no,Max_iteration,ElitistCheck,Algorithm_num,chValue);
end
if Algorithm_num==8
cg_curve=GSA(F_index,P_no,Max_iteration,ElitistCheck,Algorithm_num,chValue);
end
if Algorithm_num==9
cg_curve=GSA(F_index,P_no,Max_iteration,ElitistCheck,Algorithm_num,chValue);
end
if Algorithm_num==10
cg_curve=GSA(F_index,P_no,Max_iteration,ElitistCheck,Algorithm_num,chValue);
end
if Algorithm_num==11
cg_curve=GSA(F_index,P_no,Max_iteration,ElitistCheck,Algorithm_num,chValue);
end
temp(i,:)=cg_curve;
end
All_Convergence_curves(Algorithm_num,:)=mean(temp);
end
figure
for k = 1:size(All_Convergence_curves,1)
semilogy(All_Convergence_curves(k,:))
hold on
end
legend('GSA', 'CGSA1', 'CGSA2', 'CGSA3', 'CGSA4', 'CGSA5', 'CGSA6', 'CGSA7', 'CGSA8', 'CGSA9', 'CGSA10')
save resuls
[1]龚安, 吕倩, 胡长军, 康忠健, & 李华昱. (2015). 基于混沌万有引力搜索算法的svm参数优化及应用. 计算机科学, 42(4), 4.