??个人主页:Matlab科研工作室
??个人信条:格物致知。
更多Matlab仿真内容点击??
智能优化算法 神经 络预测 雷达通信 无线传感器
信 处理 图像处理 路径规划 元胞自动机 无人机 电力系统
? 内容介绍
除了已经成功模拟的鸟类、蜜蜂和蚂蚁,自然界中还有其他生物如萤火虫、细菌等值得研究。海豚也不例外。相反,海豚具有许多可以模拟的生活习性和生物学特征,例如信息交流、分工、合作和回声定位。在他们的掠夺过程中,包括搜索、呼叫、接收和捕食在内的几个阶段都会派上用场,以实现他们的目标。在美国佛罗里达州的大西洋沿岸,观察到宽吻海豚的合作摄食行为。称为泥环喂料。它也被称为泥羽钓鱼[6]. 海豚采用这种狩猎策略来觅食和诱捕鱼类。羽毛是由一只海豚在沙子中快速移动尾巴并在一群鱼周围游泳时产生的。鱼儿变得迷失方向,因为它在它们周围生成了一个瞬间的 。鱼跃过水面,却发现海豚从羽流中跃出捕捉它们。图 1展示了从头顶依次进行的“泥羽供给”。
? 部分代码
%_________________________________________________________________________%
% Mud Ring Algorithm (MRA) source codes demo 1.0 %
% %
% Developed in MATLAB R2020a %
% %
% You can simply define your cost in a seperate file and load its handle to fobj
% The initial parameters that you need are:
%__________________________________________
% fobj = @YourCostFunction
% dim = number of your variables
% T_max = maximum number of generations
% 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
% If all the variables have equal lower bound you can just
% define lb and ub as two single number numbers
% To run MRA: [MRLeader_score,MRLeader_pos,MRA_convergence_curve]=MRA(T_max, SearchAgents_no, dim, lb, ub, fobj)
%__________________________________________
close all
clear all
clc
SearchAgents_no=30; % Number of search agents
Function_name=’F3′; % Name of the test function that can be from F1 to F29 (Table 6,7,8, and 9 in the paper)
T_max=100; % Maximum numbef of iterations
% Load details of the selected benchmark function
[lb,ub,dim,fobj]=Get_Functions_details(Function_name);
[MRLeader_score,MRLeader_pos,MRA_convergence_curve]=MRA(T_max, SearchAgents_no, dim, lb, ub, fobj);
figure(‘Position’,[269 240 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(MRA_convergence_curve,’Color’,’r’)
title(‘Objective space’)
xlabel(‘Iteration’);
ylabel(‘Best score obtained so far’);
axis tight
grid on
box on
legend(‘MRA’)
img =gcf; %获取当前画图的句柄
print(img, ‘-dpng’, ‘-r600’, ‘./运行结果33.png’) %即可得到对应格式和期望dpi的图像
display([‘The best solution obtained by MRA is : ‘, num2str(MRLeader_pos)]);
display([‘The best optimal value of the objective funciton found by MRA is : ‘, num2str(MRLeader_score)]);
? 运行结果
? 参考文献
?? 关注我领取海量matlab电子书和数学建模资料
??部分理论引用 络文献,若有侵权联系博主删除
文章知识点与官方知识档案匹配,可进一步学习相关知识算法技能树首页概览35127 人正在系统学习中
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!