【獲取資源請見文章第5節(jié):資源獲取】
1. 原始POA算法
此算法詳細(xì)介紹請參考POA算法介紹
2. 改進(jìn)后的IPOA算法
2.1 Sine映射種群初始化
混沌映射可以使種群在搜索空間中的分布更加均勻,因此被廣泛使用。其中,Sine映射是一種不錯(cuò)的映射方式,其數(shù)學(xué)表達(dá)式為:
x
n
+
1
=
a
4
s
i
n
(
π
?
x
n
)
(1)
x_{n+1}=\frac{a}{4}sin(\pi*x_{n})\tag1
xn+1?=4a?sin(π?xn?)(1)
2.2 融合改進(jìn)的正余弦策略
正余弦優(yōu)化算法利用正余弦函數(shù)的周期性波動構(gòu)造迭代方程,實(shí)現(xiàn)全局搜索和局部開發(fā)兩個(gè)階段的功能。具體的迭代方程分為以下兩類正弦迭代或迭代余弦方程:
其中,
t
t
t為當(dāng)前迭代次數(shù),
X
i
j
(
t
)
X_{i}^{j}(t)
Xij?(t)表示第
t
t
t次迭代時(shí)第
i
i
i個(gè)個(gè)體的第
j
j
j維變量,
r
1
r_{1}
r1?和
r
3
r_{3}
r3?表示[0,1]之間的隨機(jī)數(shù),
r
2
r_{2}
r2?表示[0,2π]之間的隨機(jī)數(shù),
P
b
e
s
t
(
t
)
P_{best}(t)
Pbest?(t)表示第
t
t
t次迭代的最優(yōu)解。
為了進(jìn)一步提高POA算法的全局開發(fā)能力,在引入了正余弦策略的基礎(chǔ)上,還加入了鯨魚優(yōu)化算法的螺旋更新策略。
2.3 Levy飛行策略
在原始POA算法的探索階段,容易陷入局部最優(yōu),為了提高跳出局部最優(yōu)的能力,可以使用萊維飛行策略進(jìn)行位置更新使得這部分鵜鶘個(gè)體去到更廣的搜索空間:
3. 部分代碼展示
%%
clc
clear
close all
%%
Fun_name='F1'; % number of test functions: 'F1' to 'F23'
SearchAgents=30; % number of Pelicans (population members)
Max_iterations=500; % maximum number of iteration
[lb,ub,dim,fobj]=Get_Functions_details(Fun_name); % Object function information
[Best_score_POA,Best_pos_POA,POA_curve]=POA(SearchAgents,Max_iterations,lb,ub,dim,fobj);
[Best_score_SSA,Best_pos_SSA,SSA_curve]=SSA(SearchAgents,Max_iterations,lb,ub,dim,fobj);
[Best_score_WOA,Best_pos_WOA,WOA_curve]=WOA(SearchAgents,Max_iterations,lb,ub,dim,fobj);
[Best_score_GWO,Best_pos_GWO,GWO_curve]=GWO(SearchAgents,Max_iterations,lb,ub,dim,fobj);
[Best_score_IPOA,Best_pos_IPOA,IPOA_curve]=IPOA(SearchAgents,Max_iterations,lb,ub,dim,fobj);
%%
figure('Position',[454 445 694 297]);
subplot(1,2,1);
func_plot(Fun_name);
title('Parameter space')
xlabel('x_1');
ylabel('x_2');
zlabel([Fun_name,'( x_1 , x_2 )'])
subplot(1,2,2);
t = 1:Max_iterations;
semilogy(t, POA_curve, 'b-', t, SSA_curve, 'k-', t, WOA_curve, 'g-', t, GWO_curve, 'm-', t, IPOA_curve, 'r-','linewidth', 1.5);
title(Fun_name)
xlabel('Iteration');
ylabel('Best fitness function');
axis tight
legend('POA','SSA','WOA','GWO','IPOA')
display(['The best solution obtained by POA for ' [num2str(Fun_name)],' is : ', num2str(Best_pos_POA)]);
display(['The best optimal value of the objective funciton found by POA for ' [num2str(Fun_name)],' is : ', num2str(Best_score_POA)]);
display(['The best solution obtained by SSA for ' [num2str(Fun_name)],' is : ', num2str(Best_pos_SSA)]);
display(['The best optimal value of the objective funciton found by SSA for ' [num2str(Fun_name)],' is : ', num2str(Best_score_SSA)]);
display(['The best solution obtained by WOA for ' [num2str(Fun_name)],' is : ', num2str(Best_pos_WOA)]);
display(['The best optimal value of the objective funciton found by WOA for ' [num2str(Fun_name)],' is : ', num2str(Best_score_WOA)]);
display(['The best solution obtained by GWO for ' [num2str(Fun_name)],' is : ', num2str(Best_pos_GWO)]);
display(['The best optimal value of the objective funciton found by GWO for ' [num2str(Fun_name)],' is : ', num2str(Best_score_GWO)]);
display(['The best solution obtained by IPOA for ' [num2str(Fun_name)],' is : ', num2str(Best_pos_IPOA)]);
display(['The best optimal value of the objective funciton found by IPOA for ' [num2str(Fun_name)],' is : ', num2str(Best_score_IPOA)]);
4. 仿真結(jié)果展示
文章來源:http://www.zghlxwxcb.cn/news/detail-707749.html
5. 資源獲取
可以獲取完整代碼資源。文章來源地址http://www.zghlxwxcb.cn/news/detail-707749.html
到了這里,關(guān)于【群智能算法改進(jìn)】一種改進(jìn)的鵜鶘優(yōu)化算法 IPOA算法[1]【Matlab代碼#57】的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!