1 简介蝠鲼觅食优化 (Manta ray foraging optimizationMRFO)是由 Zhao 等在 2019 年提出的新型智能仿生群体算法。2 部分代码%_________________________%% 蝠鲼觅食优化算法 %%_________________________%% 使用方法%______________% fobj YourCostFunction 设定适应度函数% dim number of your variables 设定维度% Max_iteration 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 SSA: [Best_pos,Best_score,curve]MRFO(pop,Max_iter,lb,ub,dim,fobj)%______________clear allclcSearchAgents_no30; % Number of search agents 种群数量Function_nameF1; % Name of the test function that can be from F1 to F23 (Table 1,2,3 in the paper) 设定适应度函数Max_iteration200; % Maximum numbef of iterations 设定最大迭代次数% Load details of the selected benchmark function[lb,ub,dim,fobj]Get_Functions_details(Function_name); %设定边界以及优化函数[Best_pos,Best_score,MRFO_curve]MRFO(SearchAgents_no,Max_iteration,fobj,lb,ub,dim); %开始优化figure(Position,[269 240 660 290])%Draw search spacesubplot(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 spacesubplot(1,2,2);plot(MRFO_curve,Color,r,linewidth,1.5)title(Objective space)xlabel(Iteration);ylabel(Best score obtained so far);axis tightgrid onbox onlegend(MRFO)display([The best solution obtained by MRFO is : , num2str(Best_pos)]);display([The best optimal value of the objective funciton found by MRFO is : , num2str(Best_score)]);img gcf; %获取当前画图的句柄print(img, -dpng, -r600, ./运行结果2.png) %即可得到对应格式和期望dpi的图像3 仿真结果4 参考文献[1]凤盛强. 基于蝠鲼觅食优化算法的配电网故障区间定位. 兰州文理学院学报自然科学版 35.1(2021):5.### 博主简介擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真有科研问题可私信交流。**部分理论引用网络文献若有侵权联系博主删除。**
阅读完成 · 觉得有帮助?