• 大小: 12KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-29
  • 语言: Matlab
  • 标签: NSGA-II  

资源简介

NSGA-II matlab 的源码,一个简单的NSGA-II matlab实现代码

资源截图

代码片段和文件信息

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  MATLAB Code for                                              %
%                                                               %
%  Non-dominated Sorting Genetic Algorithm II (NSGA-II)         %
%  Version 1.0 - April 2010                                     %
%                                                               %
%  Programmed By: S. Mostapha Kalami Heris                      %
%                                                               %
%         e-Mail: sm.kalami@gmail.com                           %
%                 kalami@ee.kntu.ac.ir                          %
%                                                               %
%       Homepage: http://www.kalami.ir                          %
%                                                               %
%  BinaryTournamentSelection.m : implelemnts binary tournament  %
%                                selection                      %
%                                                               %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function p=BinaryTournamentSelection(pop)

    npop=numel(pop);
    
    i=randi([1 2][1 npop]);
    
    p1=pop(i(1));
    p2=pop(i(2));
    
    if p1.Rank < p2.Rank
        p=p1;
    elseif p1.Rank > p2.Rank
        p=p2;
    else
        if p1.CrowdingDistance>p2.CrowdingDistance
            p=p1;
        else
            p=p2;
        end
    end

end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-09-03 14:24  NSGA-II\
     目录           0  2017-09-03 14:24  NSGA-II\NSGA-II\
     文件        1521  2013-06-26 16:02  NSGA-II\NSGA-II\BinaryTournamentSelection.m
     文件        1637  2013-08-01 19:19  NSGA-II\NSGA-II\CalcCrowdingDistance.m
     文件        1242  2013-06-26 16:02  NSGA-II\NSGA-II\Cost.m
     文件        1533  2017-09-03 15:02  NSGA-II\NSGA-II\CreateEmptyIndividuals.m
     文件        1357  2013-06-26 16:02  NSGA-II\NSGA-II\Crossover.m
     文件        1244  2013-06-26 16:02  NSGA-II\NSGA-II\Dominates.m
     文件        1187  2013-06-26 16:02  NSGA-II\NSGA-II\GetCosts.m
     文件        1317  2013-06-26 16:02  NSGA-II\NSGA-II\Mutate.m
     文件         141  2013-09-05 19:26  NSGA-II\NSGA-II\MyCost1.m
     文件         121  2013-09-29 13:24  NSGA-II\NSGA-II\MyCost2.m
     文件         168  2013-09-05 19:27  NSGA-II\NSGA-II\MyCost3.m
     文件         147  2013-09-27 14:30  NSGA-II\NSGA-II\MyCost4.m
     文件         163  2013-09-27 14:17  NSGA-II\NSGA-II\MyCost5.m
     文件         231  2013-09-05 19:22  NSGA-II\NSGA-II\MyCost6.m
     文件         271  2013-09-05 19:21  NSGA-II\NSGA-II\MyCost7.m
     目录           0  2014-06-19 16:25  NSGA-II\NSGA-II\New Folder\
     文件        1773  2013-06-26 16:02  NSGA-II\NSGA-II\New Folder\MyCost1.m
     文件        3000  2017-09-03 15:26  NSGA-II\NSGA-II\NonDominatedSorting.m
     文件        5590  2017-09-03 15:31  NSGA-II\NSGA-II\nsga2.m
     文件        1896  2013-10-01 21:14  NSGA-II\NSGA-II\PlotFronts.m
     文件        1442  2013-06-26 16:02  NSGA-II\NSGA-II\SortPopulation.m

评论

共有 条评论