多目标遗传算法代码

多目标遗传算法代码

ID:25434831

大小:64.50 KB

页数:13页

时间:2018-11-20

多目标遗传算法代码_第1页
多目标遗传算法代码_第2页
多目标遗传算法代码_第3页
多目标遗传算法代码_第4页
多目标遗传算法代码_第5页
资源描述:

《多目标遗传算法代码》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、WORD格式可编辑%functionnsga_2(pro)%%MainFunction%MainprogramtoruntheNSGA-IIMOEA.%Readthecorrespondingdocumentationtolearnmoreaboutmultiobjective%optimizationusingevolutionaryalgorithms.%initialize_variableshastwoarguments;Firstbeingthepopulationsize%andthesecondtheprob

2、lemnumber.'1'correspondstoMOP1and'2'%correspondstoMOP2.%inp_para_definition=input_parameters_definition;%%Initializethevariables%Declarethevariablesandinitializetheirvalues%pop-population%gen-generations%pro-problemnumber%clear;clc;tic;pop=100;%每一代的种群数gen=100;%总共的

3、代数pro=2;%问题选择1或者2,见switchswitchprocase1%Misthenumberofobjectives.M=2;%Visthenumberofdecisionvariables.Inthiscaseitis%difficulttovisualizethedecisionvariablesspacewhilethe%objectivespaceisjusttwodimensional.V=6;case2M=3;V=12;case3%case1和case2用来对整个算法进行常规验证,作为调试之用;ca

4、se3为本工程所需;M=2;%(outputparameters个数)V=8;%(inputparameters个数)K=10;end%Initializethepopulationchromosome=initialize_variables(pop,pro);%%Sorttheinitializedpopulation%Sortthepopulationusingnon-domination-sort.Thisreturnstwocolumns%foreachindividualwhicharetherankandth

5、ecrowdingdistance%correspondingtotheirpositioninthefronttheybelong.真是牛X了。chromosome=non_domination_sort_mod(chromosome,pro);%%Starttheevolutionprocess专业知识分享WORD格式可编辑%Thefollowingareperformedineachgeneration%Selecttheparents%PerfromcrossoverandMutationoperator%Perf

6、ormSelectionfori=1:gen%Selecttheparents%Parentsareselectedforreproductiontogenerateoffspring.The%originalNSGA-IIusesabinarytournamentselectionbasedonthe%crowded-comparisionoperator.Theargumentsare%pool-sizeofthematingpool.Itiscommontohavethistobehalfthe%population

7、size.%tour-Tournamentsize.OriginalNSGA-IIusesabinarytournament%selection,buttoseetheeffectoftournamentsizethisiskept%arbitary,tobechoosenbytheuser.pool=round(pop/2);tour=2;%下面进行二人锦标赛配对,新的群体规模是原来群体的一半parent_chromosome=tournament_selection(chromosome,pool,tour);%Per

8、fromcrossoverandMutationoperator%TheoriginalNSGA-IIalgorithmusesSimulatedBinaryCrossover(SBX)and%Polynomialcrossover.Crossoverprobabilitypc=0.9andmutati

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。