✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
海洋捕食者算法(Marine Predators Algorithm,MPA) 等人于 2020 年提出的一种新型元启发式优化算法。
⛄ 部分代码
清除所有
clc
格式long
SearchAgents_no = 25 ; % 搜索代理数量
函数名= 'F2' ; 最大迭代= 500 ; % 最大迭代次数[ lb , ub , dim , fobj ]= Get_Functions_details ( Function_name ); [ Best_score , Best_pos , Convergence_curve ]= MPA ( SearchAgents_no , Max_iteration , lb , ub , dim , fobj ); % 函数拓扑图('位置'
,[ 500 400 700 290 ])
子图( 1 , 2 , 1 );
func_plot ( Function_name );
标题('功能拓扑')
xlabel('x_1');
ylabel ( 'x_2' );
zlabel ([ Function_name , '( x_1 , x_2 )' ])
% 收敛曲线
子图( 1 , 2 , 2 );
符号学( Convergence_curve ,'Color','r')
title('Objective space')
xlabel('Iteration');
ylabel('Best score obtained so far');
display(['The best solution obtained by MPA is : ', num2str(Best_pos,10)]);
display(['The best optimal value of the objective function found by MPA is : ', num2str(Best_score,10)]);
disp(sprintf('--------------------------------------'));
img = gcf ; %获取当前画图的句柄
print ( img , '-dpng' , ' -r600' , './运行结果.png' )
⛄ 运行结果
⛄ 参考文献
[1]胡顺强,崔东文.基于海洋捕食者算法优化的长短期记忆神经网络径流预测[J].中国农村水利水电,2021(02):78-82+90.





