一、鸚鵡優化算法
鸚鵡優化算法(Parrot optimizer,PO)由Junbo?Lian等人于2024年提出的一種高效的元啟發式算法,該算法從馴養的鸚鵡中觀察到的覓食、停留、交流和對陌生人行為的恐懼中汲取靈感。這些行為被封裝在四個不同的公式中,以促進尋找最佳解決方案。與遵循單獨探索和開發階段的傳統元啟發式算法相比,PO 群體中的每個個體在每次迭代期間都會隨機表現出這四種行為中的一種。這種方法更恰當地表示了在馴化鸚鵡中觀察到的行為隨機性,并顯著增強了種群多樣性。通過偏離傳統的勘探-開采兩階段結構,PO有效地降低了被困在局部最優值中的風險,同時保持了解決方案的質量。PO的隨機結構使其與傳統算法區分開來,使其特別適合避免局部最優,并適用于現實世界的問題解決,特別是在醫學領域。
參考文獻:
[1]Lian, Junbo, et al. “Parrot Optimizer: Algorithm and Applications to Medical Problems.” Computers in Biology and Medicine, Elsevier BV, Feb. 2024, p. 108064, doi:10.1016/j.compbiomed.2024.108064.
二、23個函數介紹
參考文獻:
[1] Yao X, Liu Y, Lin G M. Evolutionary programming made faster[J]. IEEE transactions on evolutionary computation, 1999, 3(2):82-102.
三、PO求解23個函數
3.1部分代碼
close all ; clear clc Npop=30;? ? ? ? ? ? ? ?? Function_name='F1';? ? ?% Name of the test function that can be from F1 to F23 (? Tmax=300;? ? ? ? ? ? ?? [lb,ub,dim,fobj]=Get_Functions_details(Function_name); [Best_fit,Best_pos,Convergence_curve]=PO(Npop,Tmax,lb,ub,dim,fobj); figure('Position',[100 100 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(Convergence_curve,'Color','r','linewidth',3) title('Search space') xlabel('Iteration'); ylabel('Best score obtained so far'); axis tight grid on box on legend('PO') saveas(gca,[Function_name '.jpg']);display(['The best solution is ', num2str(Best_pos)]); display(['The best fitness value is ', num2str(Best_fit)]);