一種非線性權(quán)重的自適應(yīng)鯨魚優(yōu)化算法IMWOA附matlab代碼
?作者簡介:熱愛科研的
開發(fā)者,修心和技術(shù)同步精進(jìn),matlab項(xiàng)目合作可私信。??個(gè)人主頁:
??個(gè)人信條:格物致知。
更多Matlab仿真內(nèi)容點(diǎn)擊??
?? ? ?
? ? ? ? ?
? 內(nèi)容介紹
隨著現(xiàn)實(shí)生活中待優(yōu)化問題的復(fù)雜度增加,種群優(yōu)化算法得到迅速發(fā)展.目前,各種鯨魚優(yōu)化算法被提出,但是在不斷提高精度的同時(shí),卻增加了算法的復(fù)雜性.針對鯨魚優(yōu)化算法(WOA)收斂速度慢,求解精度低的問題,在優(yōu)化算法性能的基礎(chǔ)上保留鯨魚優(yōu)化算法結(jié)構(gòu)簡單的特點(diǎn),提出了基于非線性權(quán)重的自適應(yīng)鯨魚優(yōu)化算法(NWAWOA).通過非線性權(quán)重S_1和S_2對鯨魚優(yōu)化算法三個(gè)階段的位置更新公式采用兩種不同的加權(quán)策略,在平衡算法全局搜索與局部開發(fā)能力的同時(shí),加快收斂速度,提高求解精度.在10個(gè)經(jīng)典測試函數(shù)上的實(shí)驗(yàn)表明,改進(jìn)的算法與經(jīng)典粒子群算法(PSO),WOA,WOAWC算法,EWOA算法相比具有較好的收斂速度,求解精度和穩(wěn)定性,同時(shí)算法結(jié)構(gòu)簡單,易于學(xué)習(xí).
? 部分代碼
%% [1]趙傳武,黃寶柱,閻躍觀,代文晨,張建.一種非線性權(quán)重的自適應(yīng)鯨魚優(yōu)化算法[J].計(jì)算機(jī)技術(shù)與發(fā)展,2020,30(10):7-13.
clear all?
clc
SearchAgents_no=30; % Number of search agents 種群數(shù)量
Function_name='F4'; % Name of the test function that can be from F1 to F23 (Table 1,2,3 in the paper) 設(shè)定適應(yīng)度函數(shù)
Max_iteration=500; % Maximum numbef of iterations 設(shè)定最大迭代次數(shù)
% Load details of the selected benchmark function
[lb,ub,dim,fobj]=Get_Functions_details(Function_name);? %設(shè)定邊界以及優(yōu)化函數(shù)
%原始鯨魚算法
[Best_score,Best_pos,WOA_cg_curve]=WOA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj); %開始優(yōu)化
%改進(jìn)鯨魚算法
[Best_score1,Best_pos1,WOA_cg_curve1]=IMWOA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj); %開始優(yōu)化
figure('Position',[269? ?240? ?660? ?290])
%Draw search space
subplot(1,2,1);
func_plot(Function_name);
title('Parameter space')
xlabel('x_1');
ylabel('x_2');
zlabel([Function_name,'( x_1 , x_2 )'])
%Draw objective space
subplot(1,2,2);
semilogy(WOA_cg_curve,'Color','g','linewidth',1.5)
hold on
semilogy(WOA_cg_curve1,'Color','r','linewidth',1.5);
title('Objective space')
xlabel('Iteration');
ylabel('Best score obtained so far');
legend('WOA','IMAWOA');
axis tight
grid on
box on
display(['The best solution obtained by WOA is : ', num2str(Best_pos)]);
display(['The best optimal value of the objective funciton found by WOA is : ', num2str(Best_score)]);
? ? ? ??
display(['The best solution obtained by IMWOA is : ', num2str(Best_pos1)]);
display(['The best optimal value of the objective funciton found byIMWOA is : ', num2str(Best_score1)]);
? 運(yùn)行結(jié)果

? 參考文獻(xiàn)
[1]趙傳武、黃寶柱、閻躍觀、代文晨、張建. 一種非線性權(quán)重的自適應(yīng)鯨魚優(yōu)化算法[J]. 計(jì)算機(jī)技術(shù)與發(fā)展, 2020, 30(10):7.
? Matlab代碼關(guān)注
??部分理論引用網(wǎng)絡(luò)文獻(xiàn),若有侵權(quán)聯(lián)系博主刪除
?? 關(guān)注我領(lǐng)取海量matlab電子書和數(shù)學(xué)建模資料
?