• 大小: 7KB
    文件类型: .m
    金币: 2
    下载: 1 次
    发布日期: 2021-06-07
  • 语言: Matlab
  • 标签: CEC  TEST  MATLAB  

资源简介

这是“A high-efficiency adaptive artificial bee colony algorithm using two strategies for continuous optimization”这篇论文中,28个CEC测试函数的MATLAB代码,本人亲自编写,亲自测试,跟论文中的效果一样。在做群智能优化算法的同学们,可以直接拿去用了。

资源截图

代码片段和文件信息

% lb is the lower bound: lb=[lb_1lb_2...lb_d]
% up is the uppper bound: ub=[ub_1ub_2...ub_d]
% dim is the number of variables (dimension of the problem)

function [lbubdimfobj] = Get_Functions_details_28(F)


switch F
    case ‘F1‘
        fobj = @F1;
        lb=-100;
        ub=100;
        dim=10;
        
    case ‘F2‘
        fobj = @F2;
        lb=-100;
        ub=100;
        dim=10;
        
    case ‘F3‘
        fobj = @F3;
        lb=-10;
        ub=10;
        dim=10;
        
    case ‘F4‘
        fobj = @F4;
        lb=-10;
        ub=10;
        dim=10;
        
    case ‘F5‘
        fobj = @F5;
        lb=-10;
        ub=10;
        dim=10;
        
    case ‘F6‘
        fobj = @F6;
        lb=-100;
        ub=100;
        dim=10;
        
    case ‘F7‘
        fobj = @F7;
        lb=-100;
        ub=100;
        dim=10;
        
    case ‘F8‘
        fobj = @F8;
        lb=-1.28;
        ub=1.28;
        dim=10;
        
    case ‘F9‘
        fobj = @F9;
        lb=-1.28;
        ub=1.28;
        dim=10;
        
    case ‘F10‘
        fobj = @F10;
        lb=-10;
        ub=10;
        dim=10;
        
    case ‘F11‘
        fobj = @F11;
        lb=-5.12;
        ub=5.12;
        dim=10;
        
    case ‘F12‘
        fobj = @F12;
        lb=-5.12;
        ub=5.12;
        dim=10;
        
    case ‘F13‘
        fobj = @F13;
        lb=-600;
        ub=600;
        dim=10;
        
    case ‘F14‘
        fobj = @F14;
        lb=-500;
        ub=500;
        dim=10;
        
    case ‘F15‘
        fobj = @F15;
        lb=-32;
        ub=32;
        dim=10;
        
    case ‘F16‘
        fobj = @F16;
        lb=-50;
        ub=50;
        dim=10;
        
    case ‘F17‘
        fobj = @F17;
        lb=-50;
        ub=50;
        dim=10;
        
    case ‘F18‘
        fobj = @F18;
        lb=-10;
        ub=10;
        dim=10;
        
    case ‘F19‘
        fobj = @F19;
        lb=-10;
        ub=10;
        dim=10;
        
    case ‘F20‘
        fobj = @F20;
        lb=-0.5;
        ub=0.5;
        dim=10;
        
    case ‘F21‘
        fobj = @F21;
        lb=-100;
        ub=100;
        dim=10;
        
    case ‘F22‘
        fobj = @F22;
        lb=-5;
        ub=5;
        dim=10;
        
    case ‘F23‘
        fobj = @F23;
        lb=0;
        ub=pi;
        dim=10;
    case ‘F24‘
        fobj = @F24;
        lb=-100;
        ub=100;
        dim=10;
        
    case ‘F25‘
        fobj = @F25;
        lb=-5.12;
        ub=5.12;
        dim=10;
    case ‘F26‘
        fobj = @F26;
        lb=-600;
        ub=600;
        dim=10;
    case ‘F27‘
        fobj = @F27;
        lb=-32;
        ub=32;
        dim=10;
    case ‘F28‘
        fobj = @F28;
        lb=-10;
        ub=10;
        dim=10;
end

end

% F1 Sphere US

function o = F1(x)
o=sum(x.^2);
end

% F2 Elliptic UN

function o = F2(x)
dim=size(x2);
o=0;
for i=1:dim
    o=o+10^(6*(i-1)/(dim-1))*( x(1i)^2)
end
end

% F3 SumSquares

function o = F3(x)
dim=si

评论

共有 条评论