% cec09.m
%
% The Matlab version of the test instances for CEC 2009 Multiobjective
% Optimization Competition.
%
% Usage: fobj = cec09(problem_name), the handle of the function will be
% with fobj
%
% Please refer to the report for correct one if the source codes are not
% consist with the report.
% History:
% v1 Sept.08 2008
% v2 Nov.18 2008
% v3 Nov.26 2008
function fobj = cec09(name)
switch name
case 'UF1'
fobj = @UF1;
case 'UF2'
fobj = @UF2;
case 'UF3'
fobj = @UF3;
case 'UF4'
fobj = @UF4;
case 'UF5'
fobj = @UF5;
case 'UF6'
fobj = @UF6;
case 'UF7'
fobj = @UF7;
case 'UF8'
fobj = @UF8;
case 'UF9'
fobj = @UF9;
case 'UF10'
fobj = @UF10;
case 'CF1'
fobj = @CF1;
case 'CF2'
fobj = @CF2;
case 'CF3'
fobj = @CF3;
case 'CF4'
fobj = @CF4;
case 'CF5'
fobj = @CF5;
case 'CF6'
fobj = @CF6;
case 'CF7'
fobj = @CF7;
case 'CF8'
fobj = @CF8;
case 'CF9'
fobj = @CF9;
case 'CF10'
fobj = @CF10;
otherwise
fobj = @UF1;
end
end
%% UF1
% x and y are columnwise, the imput x must be inside the search space and
% it could be a matrix
function y = UF1(x)
[dim, num] = size(x);
tmp = zeros(dim,num);
tmp(2:dim,:)= (x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]))).^2;
tmp1 = sum(tmp(3:2:dim,:)); % odd index
tmp2 = sum(tmp(2:2:dim,:)); % even index
y(1,:) = x(1,:) + 2.0*tmp1/size(3:2:dim,2);
y(2,:) = 1.0 - sqrt(x(1,:)) + 2.0*tmp2/size(2:2:dim,2);
clear tmp;
end
%% UF2
% x and y are columnwise, the imput x must be inside the search space and
% it could be a matrix
function y = UF2(x)
[dim, num] = size(x);
X1 = repmat(x(1,:),[dim-1,1]);
A = 6*pi*X1 + pi/dim*repmat((2:dim)',[1,num]);
tmp = zeros(dim,num);
tmp(2:dim,:)= (x(2:dim,:) - 0.3*X1.*(X1.*cos(4.0*A)+2.0).*cos(A)).^2;
tmp1 = sum(tmp(3:2:dim,:)); % odd index
tmp(2:dim,:)= (x(2:dim,:) - 0.3*X1.*(X1.*cos(4.0*A)+2.0).*sin(A)).^2;
tmp2 = sum(tmp(2:2:dim,:)); % even index
y(1,:) = x(1,:) + 2.0*tmp1/size(3:2:dim,2);
y(2,:) = 1.0 - sqrt(x(1,:)) + 2.0*tmp2/size(2:2:dim,2);
clear X1 A tmp;
end
%% UF3
% x and y are columnwise, the imput x must be inside the search space and
% it could be a matrix
function y = UF3(x)
[dim, num] = size(x);
Y = zeros(dim,num);
Y(2:dim,:) = x(2:dim,:) - repmat(x(1,:),[dim-1,1]).^(0.5+1.5*(repmat((2:dim)',[1,num])-2.0)/(dim-2.0));
tmp1 = zeros(dim,num);
tmp1(2:dim,:)= Y(2:dim,:).^2;
tmp2 = zeros(dim,num);
tmp2(2:dim,:)= cos(20.0*pi*Y(2:dim,:)./sqrt(repmat((2:dim)',[1,num])));
tmp11 = 4.0*sum(tmp1(3:2:dim,:)) - 2.0*prod(tmp2(3:2:dim,:)) + 2.0; % odd index
tmp21 = 4.0*sum(tmp1(2:2:dim,:)) - 2.0*prod(tmp2(2:2:dim,:)) + 2.0; % even index
y(1,:) = x(1,:) + 2.0*tmp11/size(3:2:dim,2);
y(2,:) = 1.0 - sqrt(x(1,:)) + 2.0*tmp21/size(2:2:dim,2);
clear Y tmp1 tmp2;
end
%% UF4
% x and y are columnwise, the imput x must be inside the search space and
% it could be a matrix
function y = UF4(x)
[dim, num] = size(x);
Y = zeros(dim,num);
Y(2:dim,:) = x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]));
H = zeros(dim,num);
H(2:dim,:) = abs(Y(2:dim,:))./(1.0+exp(2.0*abs(Y(2:dim,:))));
tmp1 = sum(H(3:2:dim,:)); % odd index
tmp2 = sum(H(2:2:dim,:)); % even index
y(1,:) = x(1,:) + 2.0*tmp1/size(3:2:dim,2);
y(2,:) = 1.0 - x(1,:).^2 + 2.0*tmp2/size(2:2:dim,2);
clear Y H;
end
%% UF5
% x and y are columnwise, the imput x must be inside the search space and
% it could be a matrix
function y = UF5(x)
N = 10.0;
E = 0.1;
[dim, num] = size(x);
Y = zeros(dim,num);
Y(2:dim,:) = x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]));
H = zeros(dim,num);
H(2:dim,:) = 2.0*Y(2:dim,:).^2 - cos(4.0*pi*Y(2:dim,:)) + 1.0;
tmp1 = sum(H(3:2:dim,:)); % odd index
tmp2 = sum(H(2:2:dim,:)); % even index
tmp = (0.5/N+E)*abs(sin(2.0*N*pi*x(1,:)));
y(1,:) = x(1,:) + tmp + 2.0*tmp1/size(3:2:dim,2);
y(2,:) = 1.0 - x(1,:)+ tmp + 2.0*tmp2/size(2:2:dim,2);
clear Y H;
end
%% UF6
% x and y are columnwise, the imput x must be inside the search space and
% it could be a matrix
function y = UF6(x)
N = 2.0;
E = 0.1;
[dim, num] = size(x);
Y = zeros(dim,num);
Y(2:dim,:) = x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]));
tmp1 = zeros(dim,num);
tmp1(2:dim,:)= Y(2:dim,:).^2;
tmp2 = zeros(dim,num);
tmp2(2:dim,:)= cos(20.0*pi*Y(2:dim,:)./sqrt(repmat((2:dim)',[1,num])));
tmp11 = 4.0*sum(tmp1(3:2:dim,:)) - 2.0*prod(tmp2(3:2:dim,:)) + 2.0; % odd index
tmp21 = 4.0*sum(tmp1(2:2:dim,:)) - 2.0*prod(tmp2(2:2:dim,:)) + 2.0; % even index
tmp = max(0,(1.0/N+2.0*E)*sin(2.0*N*pi*x(1,:)));
y(1,:) = x(1,:) + tmp + 2.0*tmp11/size(3:2:dim,2);
y(2,:) = 1.0 - x(1,:) + tmp + 2.0*tmp21/size(2:2:dim,2);
clear Y tmp1 tmp2;
end
%% UF7
% x and y are columnwise, the imput x must be inside the search space and
% it could be a matrix
function y = UF7(x)
[dim, num] = size(x);
Y = zeros(dim,num);
Y(2:dim,:) = (x(2:dim,:) - sin(6.0*pi*repmat(x(1,:),[dim-1,1]) + pi/dim*repmat((2:dim)',[1,num]))).^2;
tmp1 = sum(Y(3:2:dim,:)); % odd index
tmp2 = sum(Y(2:2:dim,:)); % even index
tmp = (x(1,:)).^0.2;
y(1,:) = tmp + 2.0*tmp1/size(3:2:dim,2);
y(2,:) = 1.0 - tmp + 2.0*tmp2/size(2:2:dim,2);
clear Y;
end
%% UF8
% x and y are columnwise, the imput x must be inside the search space and
% it could be a matrix
function y = UF8(x)
[dim, num] = size(x);
Y = zeros(dim,num);
Y(3:dim,:) = (x(3:dim,:) - 2.0*repmat(x(2,:),[dim-2,1]).*sin(2.0*pi*repmat(x(1,:),[dim-2,1]) + pi/dim*repmat((3:dim)',[1,num]))).^2;
tmp1 = sum(Y(4:3:dim,:)); % j-1 = 3*k
tmp2 = sum(Y(5:3:dim,:)); % j-2 = 3*k
tmp3 = sum(Y(3:3:dim,:)); % j-0 = 3*k
y(1,:) = cos(0.5*pi*x(1,:)).*cos(0.5*pi*x(2,:)) + 2.0*tmp1/size(4:3:dim,2);
y(2,:) = cos(0.5*pi*x(1,:)).*sin(0.5*pi*x(2,:)) + 2.0*tmp2/size(5:3:dim,2);
y(3,:) = sin(0.5*pi*x(1,:)) + 2.0*tmp3/size(3:3:dim,2);
clear Y;
end
%% UF9
% x and y are columnwise, the imput x must be inside the search space and
% it could be a matrix
function y = UF9(x)
E = 0.1;
[dim, num] = size(x);
Y = zeros(dim,num);
Y(3:dim,:) = (x(3:dim,:) - 2.0*repmat(x(2,:),[dim-2,1]).*sin(2.0*pi*repmat(x(1,:),[dim-2,1]) + pi/dim*repmat((3:dim)',[1,num]))).^2;
tmp1 = sum(Y(4:3:dim,:)); % j-1 = 3*k
tmp2 = sum(Y(5:3:dim,:)); % j-2 = 3*k
tmp3 = sum(Y(3:3:dim,:)); % j-0 = 3*k
tmp = max(0,(1.0+E)*(1-4.0*(2.0*x(1,:)-1).^2));
y(1,:) = 0.5*(tmp+2*x(1,:)).*x(2,:) + 2.0*tmp1/size(4:3:dim,2);
y(2,:) = 0.5*(tmp-2*x(1,:)+2.0).*x(2,:) + 2.0*tmp2/size(5:3:dim,2);
y(3,:)
没有合适的资源?快使用搜索试试~ 我知道了~
多目标饥饿游戏算法MOHGS Matlab
共17个文件
m:17个
需积分: 3 5 下载量 175 浏览量
2023-08-15
16:31:41
上传
评论 1
收藏 21KB ZIP 举报
温馨提示
多目标饥饿游戏算法MOHGS Matlab 适合智能计算方向研究生学习 饥饿游戏算法HGS求解多目标优化问题 代码完整 属于改进的HGS算法 本研究提出了一种通用的基于种群的优化技术- -饥饿博弈搜索( Hunger Games Search,HGS ),该技术具有简单的结构、特殊的稳定性特征和非常有竞争力的性能,能够更有效地实现有约束和无约束问题的求解。所提出的HGS是根据动物饥饿驱动的活动和行为选择而设计的。这种动态的、适合度的搜索方法遵循了一个简单的概念,即"饥饿"是所有动物生命中行为、决策和行动的最重要的稳态动机和原因,使优化过程对新用户和决策者来说更容易理解和一致。饥饿游戏搜索将饥饿的概念融入到特征过程中;设计了基于饥饿概念的自适应权重,用于模拟饥饿对每个搜索步骤的影响。它遵循几乎所有动物使用的计算逻辑规则(游戏),这些对手的活动和游戏通常是适应性进化的,通过获得更高的生存和食物获得的机会。该方法的主要特点是具有动态性,结构简单,在收敛性和可接受的解的质量方面具有较高的性能,证明比现有的优化方法更有效。
资源推荐
资源详情
资源评论
收起资源包目录
MOHGS.zip (17个子文件)
MOHGS
CreateEmptyParticle.m 4KB
RouletteWheelSelection.m 3KB
DeleteFromRep.m 4KB
GetOccupiedCells.m 3KB
Get_Functions_HGS.m 8KB
main.m 3KB
Dominates.m 3KB
cec09.m 18KB
GetNonDominatedParticles.m 3KB
CreateHypercubes.m 4KB
xboundary.m 1KB
GetGridIndex.m 4KB
HGS.m 7KB
DetermineDomination.m 4KB
GetCosts.m 3KB
CalFitness.m 1KB
SelectLeader.m 4KB
共 17 条
- 1
资源评论
背包客研究
- 粉丝: 613
- 资源: 111
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功