赞
踩
河马优化算法(Hippopotamus optimization algorithm,HO)由Amiri等人于2024年提出,该算法模拟了河马在河流或池塘中的位置更新、针对捕食者的防御策略以及规避方法。2024最新算法:河马优化算法(HO)求解23个基准函数_hippopotamus optimization algorithm: a novel natur-CSDN博客
参考文献:
[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.
- clc
- clear
- close all
- tic
- %% 地图
- global G S E
- G=[0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0;
- 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0;
- 0 0 1 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0;
- 0 0 1 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0;
- 0 0 1 0 0 0 0 1 1 0 0 0 1 1 1 1 1 0 0 0;
- 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0;
- 0 1 1 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0;
- 0 1 1 1 0 0 1 1 1 0 1 1 1 1 0 0 0 0 0 0;
- 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 1 1 0 0;
- 0 0 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1 0 0;
- 0 0 1 0 0 0 0 1 1 0 1 1 1 1 0 0 0 1 0 0;
- 0 0 1 0 0 0 0 1 1 0 1 1 1 1 0 0 0 0 0 0;
- 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 0;
- 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0;
- 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0;
- 1 1 1 1 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0;
- 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0 0 1 1 0;
- 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0;
- 0 0 1 1 0 0 0 0 0 0 1 1 0 1 1 1 0 0 0 0;
- 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0;];
- for i=1:20/2
- for j=1:20
- m=G(i,j);
- n=G(21-i,j);
- G(i,j)=n;
- G(21-i,j)=m;
- end
- end
- %%
- S = [1 1]; %起点
- E = [20 20]; %终点
- [ub,dimensions] = size(G);
- dim = dimensions - 2;
- %% 参数设置
- Max_iter= 200; % 最大迭代次数
- SearchAgents_no = 50; % 种群数量
- X_min = 1;
- lb=1;
- fobj=@(x)fitness(x);
- [Best_score,Best_NC,Convergence_curve]=HO(SearchAgents_no,Max_iter,lb,ub,dim,fobj);
-
-
- toc
- %% 结果分析
- global_best = round(Best_NC);
- figure(1)
- plot(Convergence_curve,'b-','linewidth',2.5)
- xlabel('Iteration');
- ylabel('Fitness');
- legend('HO')
点击main.m即可运行。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。