【氣味代理優(yōu)化算法】基于氣味代理優(yōu)化算法求解單目標(biāo)優(yōu)化問題附matlab代碼
1 簡(jiǎn)介
本文針對(duì)一些 CEC 數(shù)值優(yōu)化基準(zhǔn)函數(shù)和混合可再生能源系統(tǒng) (HRES) 工程問題,對(duì)稱為氣味代理優(yōu)化 (SAO) 的新元啟發(fā)式算法進(jìn)行了廣泛研究。 SAO 實(shí)現(xiàn)了氣味代理和蒸發(fā)氣味分子的對(duì)象之間的關(guān)系。這些關(guān)系被建模為三種獨(dú)立的模式,稱為嗅探模式、尾隨模式和隨機(jī)模式。當(dāng)氣味分子從氣味源向代理擴(kuò)散時(shí),嗅探模式模擬代理的氣味感知能力。尾隨模式模擬代理跟蹤氣味分子的一部分直到其來(lái)源被識(shí)別的能力。然而,隨機(jī)模式是代理用來(lái)避免陷入局部最小值的一種策略。對(duì) 37 個(gè)常用的 CEC 基準(zhǔn)函數(shù)和 HRES 工程問題進(jìn)行了測(cè)試,并將結(jié)果與其他 6 種元啟發(fā)式方法進(jìn)行了比較。實(shí)驗(yàn)結(jié)果表明,SAO 可以在 76% 的基準(zhǔn)函數(shù)中找到全局最優(yōu)值。同樣,統(tǒng)計(jì)結(jié)果表明,與基準(zhǔn)算法相比,SAO 也獲得了最具成本效益的 HRES 設(shè)計(jì)。
2 部分代碼
%__________________________________________
% myCost = @YourCostFunction
% dim = number of your variables
% Max_Iter = maximum number of generations
% nMole = number of search agents
% lb=[lb1,lb2,...,lbn] where lbn is the lower bound of variable n
% ub=[ub1,ub2,...,ubn] where ubn is the upper bound of variable n
% If all the variables have equal lower bound you can just
% define lb and ub as two single number numbers
% To run SAO: [Best_score,Best_mole,Convergence]=SAO(nMole,Max_Iter,lb,ub,dim,fobj);
%__________________________________________
clear all
close all
clc
format long
nMole=50; % Number of search agents
F_name='F4'; % Selecte Benchmark Function
Max_Iter=200; % Maximum numbef of iterations
run=1;
% Load Function Details
[lb,ub,dim,myCost]=Select_Function(F_name);
for k=1:run
? ?[Best_score,Best_mole,Convergence]=SAO(nMole,Max_Iter,lb,ub,dim,myCost);
? ?Best_score(k,:)=Best_score;
end
Best=min(Best_score)
% Worst=max(Best_score)
% Average=mean(Best_score)
% STD=std(Best_score)
figure('Position',[500 500 660 290])
%Draw objective space
subplot(1,2,2);
semilogy(Convergence,'Color','r','linewidth',2)
title('Objective space')
xlabel('Iteration');
ylabel('Best score obtained so far');
axis tight
grid on
box on
legend('SAO')
%Draw function in hyperspace
subplot(1,2,1);
func_plot(F_name);
title('Parameter space')
xlabel('x_1');
ylabel('x_2');
zlabel([F_name,'( x_i , x_j )'])
3 仿真結(jié)果



4 參考文獻(xiàn)
[1] Salawudeen, A. T. , et al. "A Novel Smell Agent Optimization (SAO): An extensive CEC study and engineering application." Knowledge-Based Systems 4(2021):107486.
博主簡(jiǎn)介:擅長(zhǎng)智能優(yōu)化算法、神經(jīng)網(wǎng)絡(luò)預(yù)測(cè)、信號(hào)處理、元胞自動(dòng)機(jī)、圖像處理、路徑規(guī)劃、無(wú)人機(jī)等多種領(lǐng)域的Matlab仿真,相關(guān)matlab代碼問題可私信交流。
部分理論引用網(wǎng)絡(luò)文獻(xiàn),若有侵權(quán)聯(lián)系博主刪除。
