分享一些经典的智能优化算法源码!
欢迎自取,点点关注,非常感谢!
后续也会出一些自己改进的智能优化算法,欢迎大家相互讨论!
麻雀优化算法matlab源码
链接:https://pan.baidu.com/s/1EAny7XdT-G2LHC3mlVM0Zw
提取码:zy94
部分代码:
clc
clear
close all
SearchAgents_no=100; % Number of search agents
Function_name='F3'; % Name of the test function that can be from F1 to F23 (Table 1,2,3 in the paper)
Max_iteration=1000; % Maximum numbef of iterations
% Load details of the selected benchmark function
[lb,ub,dim,fobj]=Get_Functions_details(Function_name);
[fMin,bestX,SSA_curve]=SSA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj);
%Draw objective space
semilogy(SSA_curve,'Color','g')
axis ([0 1000 0 1 ])
title('Objective space')
xlabel('Iteration');
ylabel('Best score obtained so far');
%axis tight
grid on
box on
legend('SSA')
display(['The best solution obtained by SSA is : ', num2str(bestX)]);
display(['The best optimal value of the objective funciton found by SSA is : ', num2str(fMin)]);
实验结果: