function index = TournamentSelection(K,N,varargin)
%TournamentSelection - Tournament selection
%
% P = TournamentSelection(K,N,fitness1,fitness2,...) returns the indices
% of N solutions by K-tournament selection based on their fitness values.
% In each selection, the candidate having the minimum fitness1 value will
% be selected; if more than one candidates have the same minimum value of
% fitness1, then compare their fitness2 values, and so on.
%
% Example:
% P = TournamentSelection(2,100,FrontNo)
%--------------------------------------------------------------------------
% Copyright (c) 2016-2017 BIMK Group. You are free to use the PlatEMO for
% research purposes. All publications which use this platform or any code
% in the platform should acknowledge the use of "PlatEMO" and reference "Ye
% Tian, Ran Cheng, Xingyi Zhang, and Yaochu Jin, PlatEMO: A MATLAB Platform
% for Evolutionary Multi-Objective Optimization [Educational Forum], IEEE
% Computational Intelligence Magazine, 2017, 12(4): 73-87".
%--------------------------------------------------------------------------
varargin = cellfun(@(S)reshape(S,length(varargin{1}),1),varargin,'UniformOutput',false);
[~,rank] = sortrows([varargin{:}]);
[~,rank] = sort(rank);
Parents = randi(length(varargin{1}),K,N);
[~,best] = min(rank(Parents),[],1);
index = Parents(best+(0:N-1)*K);
end
【优化求解】基于matlab改进的遗传算法求解带约束的优化问题【含Matlab源码 1773期】.zip
版权申诉
5星 · 超过95%的资源 16 浏览量
2022-03-10
14:15:57
上传
评论 9
收藏 29KB ZIP 举报
海神之光
- 粉丝: 3w+
- 资源: 2093
最新资源
- 基于51单片机的自动浇水器设计源码+原理图pcb+使用说明.zip
- 《机器学习评估:Python混淆矩阵实战》-涵盖模型评估、分类算法,助力精准度与召回率分析,适用于数据科学和人工智能领域
- 基于51单片机的矩阵键盘密码锁源码.zip
- 基于51单片机-DS18B20实时显示温度源码.zip
- 基于Andorid设计APP控制51单片机多功能智能小车源码+功能说明.zip
- 推荐大数据治理运营整体解决方案 - 2022年.pptx
- 无论开发的一个库MTL
- 数据治理解决方案word版本.rar
- 《机器学习实战:Python随机森林回归》-涵盖数据分析、算法应用,助力精准预测与决策,适用于金融、科研及商业领域
- 多用途响应式ppt资源下载平台html模板.rar
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈