一、河馬優化算法
河馬優化算法(Hippopotamus optimization algorithm,HO)由Amiri等人于2024年提出,該算法模擬了河馬在河流或池塘中的位置更新、針對捕食者的防御策略以及規避方法。河馬優化算法的靈感來自河馬生活中觀察到的三種突出行為模式。河馬群由幾只雌性河馬、河馬幼崽、多只成年雄性河馬和一只占主導地位的雄性河馬(牛群的領導者)組成.由于它們與生俱來的好奇心,幼崽和小河馬經常表現出遠離群體的傾向。因此,它們可能會變得孤立并成為捕食者的目標。
參考文獻:
[1]Amiri, Mohammad Hussein, et al. “Hippopotamus Optimization Algorithm: a Novel Nature-Inspired Optimization Algorithm.” Scientific Reports, vol. 14, no. 1, Springer Science and Business Media LLC, Feb. 2024, doi:10.1038/s41598-024-54910-3.
二、23個函數介紹
參考文獻:
[1] Yao X, Liu Y, Lin G M. Evolutionary programming made faster[J]. IEEE transactions on evolutionary computation, 1999, 3(2):82-102.
三、HO求解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]=HO(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('HO') saveas(gca,[Function_name '.jpg']);display(['The best solution is ', num2str(Best_pos)]); display(['The best fitness value is ', num2str(Best_fit)]);
3.2部分結果
四、完整MATLAB代碼
文件夾夾內包含該算法求解23個函數的完整MATLAB代碼,點擊main.m即可運行。