💥💥💥💞💞💞欢迎来到本博客❤️❤️❤️💥💥💥



🏆博主优势:🌞🌞🌞博客内容尽量做到思维缜密,逻辑清晰,为了方便读者。



⛳️座右铭:行百里者,半于九十。


目录

​​💥1 概述​​

​​📚2 运行结果​​

​​🎉3 参考文献​​

​​🌈4 Matlab代码实现​​


💥1 概述

蚱蜢优化算法(Matlab代码实现)_开发语言

本文提出了一种称为蚱蜢优化算法(GOA)的优化算法,并将其应用于结构优化中的挑战性问题。所提出的算法在数学上模拟和模拟自然界中蚱蜢群的行为,以解决优化问题。GOA算法首先在包括CEC2005在内的一系列测试问题上进行基准测试,以定性和定量地测试和验证其性能。然后使用它来找到 52 巴桁架、3 巴桁架和悬臂梁的最佳形状,以证明其适用性。结果表明,与文献中已知的和最新的算法相比,所提出的算法能够提供更好的结果。实际应用的结果也证明了GOA在解决未知搜索空间的实际问题方面的优点。

📚2 运行结果

蚱蜢优化算法(Matlab代码实现)_算法_02

主函数代码:

clear all 
clcSearchAgents_no=100; % Number of search agents
Function_name='F1'; % Name of the test function that can be from F1 to F23 (Table 1,2,3 in the paper)
Max_iteration=500; % Maximum numbef of iterations
% Load details of the selected benchmark function
[lb,ub,dim,fobj]=Get_Functions_details(Function_name);[Target_score,Target_pos,GOA_cg_curve, Trajectories,fitness_history, position_history]=GOA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);
figure('Position',[454 445 894 297])
%Draw search space
subplot(1,5,1);
func_plot(Function_name);
title('Parameter space')
xlabel('x_1');
ylabel('x_2');
zlabel([Function_name,'( x_1 , x_2 )'])
box on
axis tightsubplot(1,5,2);
hold on
for k1 = 1: size(position_history,1)
for k2 = 1: size(position_history,2)
plot(position_history(k1,k2,1),position_history(k1,k2,2),'.','markersize',1,'MarkerEdgeColor','k','markerfacecolor','k');
end
end
plot(Target_pos(1),Target_pos(2),'.','markersize',10,'MarkerEdgeColor','r','markerfacecolor','r');
title('Search history (x1 and x2 only)')
xlabel('x1')
ylabel('x2')
box on
axis tightsubplot(1,5,3);
hold on
plot(Trajectories(1,:));
title('Trajectory of 1st grasshopper')
xlabel('Iteration#')
box on
axis tightsubplot(1,5,4);
hold on
plot(mean(fitness_history));
title('Average fitness of all grasshoppers')
xlabel('Iteration#')
box on
axis tight%Draw objective space
subplot(1,5,5);
semilogy(GOA_cg_curve,'Color','r')
title('Convergence curve')
xlabel('Iteration#');
ylabel('Best score obtained so far');
box on
axis tight
set(gcf, 'position' , [39 479 1727 267]); display(['The best solution obtained by GOA is : ', num2str(Target_pos)]);
display(['The best optimal value of the objective funciton found by GOA is : ', num2str(Target_score)]);


 

 

🎉3 参考文献

蚱蜢优化算法(Matlab代码实现)_开发语言

​🌈​​4 Matlab代码实现