多目标遗传算法代码.doc

多目标遗传算法代码.doc

ID:48917211

大小:64.00 KB

页数:14页

时间:2020-02-06

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

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

1、.%functionnsga_2(pro)%%MainFunction%MainprogramtoruntheNSGA-IIMOEA.%Readthecorrespondingdocumentationtolearnmoreaboutmultiobjective%optimizationusingevolutionaryalgorithms.%initialize_variableshastwoarguments;Firstbeingthepopulationsize%andthesecondtheproblemnumber.'1'correspondstoMOP1and'2'%c

2、orrespondstoMOP2.%inp_para_definition=input_parameters_definition;%%Initializethevariables%Declarethevariablesandinitializetheirvalues%pop-population%gen-generations%pro-problemnumber%clear;clc;tic;pop=100;%每一代的种群数gen=100;%总共的代数pro=2;%问题选择1或者2,见switchswitchprocase1%Misthenumberofobjectives.M=2

3、;%Visthenumberofdecisionvariables.Inthiscaseitis%difficulttovisualizethedecisionvariablesspacewhilethe%objectivespaceisjusttwodimensional.V=6;case2M=3;V=12;case3%case1和case2用来对整个算法进行常规验证,作为调试之用;case3为本工程所需;M=2;%(outputparameters个数)V=8;%(inputparameters个数)K=10;end%Initializethepopulationchromos

4、ome=initialize_variables(pop,pro);%%Sorttheinitializedpopulation%Sortthepopulationusingnon-domination-sort.Thisreturnstwocolumns%foreachindividualwhicharetherankandthecrowdingdistance%correspondingtotheirpositioninthefronttheybelong.真是牛X了。chromosome=non_domination_sort_mod(chromosome,pro);%%St

5、arttheevolutionprocess..%Thefollowingareperformedineachgeneration%Selecttheparents%PerfromcrossoverandMutationoperator%PerformSelectionfori=1:gen%Selecttheparents%Parentsareselectedforreproductiontogenerateoffspring.The%originalNSGA-IIusesabinarytournamentselectionbasedonthe%crowded-comparisio

6、noperator.Theargumentsare%pool-sizeofthematingpool.Itiscommontohavethistobehalfthe%populationsize.%tour-Tournamentsize.OriginalNSGA-IIusesabinarytournament%selection,buttoseetheeffectoftournamentsizethisiskept%arbitary,tobechoosenbytheuser.pool=round(pop/2);tour=2;%下面进行二人锦标赛配对,新的群体规模是原来群体的一半pa

7、rent_chromosome=tournament_selection(chromosome,pool,tour);%PerfromcrossoverandMutationoperator%TheoriginalNSGA-IIalgorithmusesSimulatedBinaryCrossover(SBX)and%Polynomialcrossover.Crossoverprobabilitypc=0.9andmutation%probabilityispm=1/

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

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

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