1 简介
海洋捕食者算法 ( Marine Predators Algorithm,MPA) 是Afshin Faramarzi 等人于 2020 年提出的一种新型元启发式优化算法.





2 部分代码
%_________________________________________________________________________
% Marine Predators Algorithm source code (Developed in MATLAB R2015a)
% --------------------------------------------
% fobj = @YourCostFunction
% dim = number of your variables
% Max_iteration = maximum number of iterations
% SearchAgents_no = 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
% ---------------------------------------------------------
clear?all
clc
format?long
SearchAgents_no=25;?% Number of search agents
Function_name='F2';
??
Max_iteration=500;?% Maximum number of iterations
[lb,ub,dim,fobj]=Get_Functions_details(Function_name);
[Best_score,Best_pos,Convergence_curve]=MPA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);
% function topology
figure('Position',[500?400?700?290])
subplot(1,2,1);
func_plot(Function_name);
title('Function Topology')
xlabel('x_1');
ylabel('x_2');
zlabel([Function_name,'( x_1 , x_2 )'])
% Convergence curve
subplot(1,2,2);
semilogy(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') ? ? ? ??%即可得到对应格式和期望dpi的图像
3 仿真结果

4 参考文献
[1]曹卫东, 柳坤, 倪建军,等. 海洋捕食者算法驱动的滚齿参数低碳求解方法:.?

|