✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,
代码获取、论文复现及科研仿真合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab完整代码及仿真定制内容点击👇
🔥 内容介绍
人类集体行为和团队运动的自然和社会方面导致了优化算法在解决工程和科学问题中的引入。元启发式算法在解决复杂的现实问题中越来越受欢迎。这项研究提出了一种新的元创新算法,称为基于足球联赛优化的冠军算法,其灵感来自于足球团队合作。该算法包括两个主要步骤:资格赛和主赛。为了评估其有效性,该算法在六个基准数学函数和两个工程设计问题上进行了测试。结果表明,该算法在一致性、收敛速度和实现最优解方面优于已知算法。
📣 部分代码
function match1=game1(match1,best_teams,nvar,npg1,ntimz,func)
teams.players=[];
teams.Score=[];
a=repmat(teams,nvar,1);
indexno=randperm(npg1);
[optgp1]=[best_teams];
optgp1=optgp1(1:npg1);
for k=1:2:npg1
%% Select the teams for the first game
r1=indexno(k);
r2=indexno(k+1);
p1=optgp1(r1);
p2=optgp1(r2);
%% chosen team
if optgp1(r1).Score < optgp1(r2).Score
a(1) = optgp1(r1);
else
a(1) = optgp1(r2);
end
for i=1:2:nvar
x1=p1.players;
x2=p2.players;
alpha=rand(size(x1));
y1=alpha.*x1+(1-alpha).*x2;
y2=alpha.*x2+(1-alpha).*x1;
a(i+1).players=y1;
a(i+2).players=y2;
a(i+1).Score=feval(func,a(i+1).players);
a(i+2).Score=feval(func,a(i+2).players);
end
Scores=[a.Score];
[value order]=sort(Scores);
a=a(order);
%% Elimination stage
if nvar>2
for l=0:ntimz
match1(k+l)=a(l+1);
end
elseif nvar==2
for l=0:ntimz+1
match1(k+l)=a(l+1);
end
elseif nvar==1
for l=0:ntimz+2
match1(k+l)=a(l+1);
end
end
end
end
⛳️ 运行结果
🔗 参考文献
本程序参考以下中文EI期刊,程序注释清晰,干货满满。
Ghasemi, M.R., Ghasri, M. and Salarnia, A., 2022. Soccer league optimization-based championship algorithm (SLOCA): A fast novel meta-heuristic technique for optimization problems. 1, 7(4), p.297.