哈里斯鹰优化算法HHO-鹈鹕优化算法POA-北方苍鹰优化算法NGO-秃鹰优化算法BES-阿基米德优化算法AOA【单目标优化算法】在23个测试函数上对比(Matlab代码实现)
% 使用方法
%__________________________________________
% 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]=SSA(pop,Max_iter,lb,ub,dim,fobj)
%__________________________________________
clc
close all
clear all
rng('default');
SearchAgents_no=30; % Number of search agents 种群数量
Function_name='F6'; % 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); %设定边界以及优化函数
%% 哈里斯鹰算法
[fMin , bestX,HHOcurve ] = HHO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj); %开始优化
%% 鹈鹕算法
[Alpha_score,Alpha_pos,POAcurve]=POA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj); %开始优化
%% 北方苍鹰算法
[gBestScore,gBest,NGOcurve]=NGO(SearchAgents_no,Max_iteration,lb,ub,dim,fobj); %开始优化
%% 秃鹰算法
[Leader_score,BEScurve]=BES(SearchAgents_no,Max_iteration,lb,ub,dim,fobj); %开始优化
%% 阿基米德算法
[Best_score,Best_pos,AOAcurve]=AOA(SearchAgents_no,Max_iteration,lb,ub,dim,fobj); %开始优化
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
