grasshoppergalapagos遗传算法精品毕业设计完整版.docx

上传人:b****6 文档编号:5805516 上传时间:2023-01-01 格式:DOCX 页数:27 大小:616.63KB
下载 相关 举报
grasshoppergalapagos遗传算法精品毕业设计完整版.docx_第1页
第1页 / 共27页
grasshoppergalapagos遗传算法精品毕业设计完整版.docx_第2页
第2页 / 共27页
grasshoppergalapagos遗传算法精品毕业设计完整版.docx_第3页
第3页 / 共27页
grasshoppergalapagos遗传算法精品毕业设计完整版.docx_第4页
第4页 / 共27页
grasshoppergalapagos遗传算法精品毕业设计完整版.docx_第5页
第5页 / 共27页
点击查看更多>>
下载资源
资源描述

grasshoppergalapagos遗传算法精品毕业设计完整版.docx

《grasshoppergalapagos遗传算法精品毕业设计完整版.docx》由会员分享,可在线阅读,更多相关《grasshoppergalapagos遗传算法精品毕业设计完整版.docx(27页珍藏版)》请在冰豆网上搜索。

grasshoppergalapagos遗传算法精品毕业设计完整版.docx

grasshoppergalapagos遗传算法精品毕业设计完整版

EvolutionaryPrinciplesappliedtoProblemSolving

遗传算法

 

ThereisnothingparticularlynewaboutEvolutionarySolversorGeneticAlgorithms.Thefirstreferencestothisfieldofcomputationstemfromtheearly60'swhenLawrenceJ.Fogelpublishedthelandmarkpaper"OntheOrganizationofIntellect"whichsparkedthefirstendeavoursintoevolutionarycomputing.Theearly70'switnessedfurtherforayswithseminalworkproducedby-amongothers-IngoRechenbergandJohnHenryHolland.EvolutionaryComputationdidn'tgainpopularitybeyondtheprogrammerworlduntilRichardDawkins'book"TheBlindWatchmaker"in1986,whichcamewithasmallprogramthatgeneratedaseeminglyendlessstreamofbody-planscalled"Bio-morphs"basedonhumanselection.Sincethe80'stheadventofthepersonalcomputerhasmadeitpossibleforindividualswithoutgovernmentfundingtoapplyevolutionaryprinciplestopersonalprojectsandtheyhavesincemadeitintothecommonparlance.

其实在遗传算法和基因算法里并什么特别新的理论出现,该领域的第一篇文献出现在六十年代由LawrenceJ.Fogel出版的具有里程碑意义的论文“智能组织”,这篇论文使人们开始致力于研究遗传算法。

七十年代又由ngoRechenbergandJohnHenryHolland的工作进一步带动了基因算法的发展,遗传算法直到1986年才因为RichardDawkins的“TheBlindWatchmake”而让人广为人知,里面有个小的例子,基于人类的选择仍然会产生无尽的被称为“生态形变”的动作计划。

80年代由于个人电脑的出现使得每个人都可以将进化算法用于个人项目而不用政府提供资金支持,从此,进化算法开始像日常话题一样进入公众视野。

Theterm"EvolutionaryComputing"mayverywellbewidelyknownatthispointintime,buttheyarestillverymuchaprogrammerstool.'Byprogrammersforprogrammers'ifyouwill.Theapplicationsouttherethatapplyevolutionarylogicareeitheraimedatsolvingspecificproblems,ortheyaregenericlibrariesthatallowotherprogrammerstopiggybackalong.ItismyhopethatGalapagoswillprovideagenericplatformfortheapplicationofEvolutionaryAlgorithmstobeusedonawidevarietyofproblemsbynon-programmers.

虽然现在进化算法在现在已经广为人知,但他大部分还作为编程工具使用,只是程序员和程序员之间交流,遗传算法即使应用也是处理一些特别的问题,大部分时间还是呆在通用库里等着程序员来用它,我希望galapagos可以提供一个遗传算法的广泛平台来让那些非编程人员来处理一些问题。

ProsandCons

赞成和反对

BeforewediveintothesubjectmattertoodeeplythoughIfeelitisimportanttohighlightsomeofthe(dis)advantagesofthisparticulartypeofsolver,justsoyouknowwhattoexpect.Sincewearenotlivinginthebestofallpossibleworldsthereisoftennosuchthingastheperfectsolution.Everyapproachhasdrawbacksandlimitations.InthecaseofEvolutionaryAlgorithmstheseareluckilywellknownandeasilyunderstooddrawbacks,eventhoughtheyarenottrivial.Indeed,theymaywellbeprohibitiveformanyaparticularproblem.

在我们深入探讨这个问题之前,我认为有必要向大家介绍这类特殊算法处理方式的优缺点,这样可能更利于你了解你到底想通过这个获得什么。

事实上我们生活在一个不完美的世界,没有什么事情会有一个完美地解决方案,每个解决方案都会有他的缺陷和限制。

而在遗传算法领域可喜的是我们明确地知道他的一些缺陷,而且这些缺陷也不小,而且确实在一些具体问题的处理上明确禁止用遗传算法来解决。

Firstly;EvolutionaryAlgorithmsareslow.Deadslow.Itisnotunheardofthatasingleprocessmayrunfordaysorevenweeks.Especiallycomplicatedset-upsthatrequirealongtimeinordertosolveasingleiterationwillquicklyrunoutofhand.Alight/shadoworacousticcomputationforexamplemayeasilytakeaminuteperiteration.Ifweassumewe'llneedatleast50generationsof50individualseach(whichisalmostcertainlyanunderestimateunlesstheproblemhasaveryobvioussolution.)we'realreadylookingatatwo-dayruntime.

首先,遗传算法在运行起来的时候很慢,奇慢,非常慢,慢的要死。

一个小程序运行几天甚至几个星期一点也不见怪,尤其是需要长时间简单迭代的复杂数据结构,运行起来会马上超出你的掌控,就算简单的光影分析或者是声学分析每次迭代就要几分钟,假设我们设置50代,每代50个个体(这都是按照最少最理想的状态来设定的),那这个程序需要两天才能做完。

Secondly,EvolutionaryAlgorithmsdonotguaranteeasolution.Unlessapredefined'good-enough'valueisspecified,theprocesswilltendtorunonindefinitely,neverreachingTheAnswer,or,havingreachedit,notrecognizingitforwhatitis.

其次,遗传算法并不能百分之百的保证求出正确的解,除非一个预先你已经想好的差不多的解已经确定下来,遗传算法会尽量的朝着你想要的那个解努力,但是他永远不会找到“真理”,当然,也可能找到了只不过他是电脑,根本意识不到那个是最优解,即“真理”。

Allisnotbleakanddismalhowever,EvolutionaryAlgorithmshavestrongbenefitsaswell,someofthemratheruniqueamongsttheplethoraofcomputationalmethods.Theyareremarkablyflexibleforexample,abletotackleawidevarietyofproblems.Thereareclassesofproblemswhicharebydefinitionbeyondthereachofeventhebestsolverimplementationandotherclassesthatareverydifficulttosolve,butthesearetypicallyrareintheprovinceofthehumanmeso-world.Byandlargetheproblemsweencounteronadailybasisfallintothe'evolutionarysolvable'category.

当然,遗传算法也并不是上面我说的那么单调无力,一直被吐槽。

进化算法在一些方面也有着强大的性能体现,在茫茫多的计算算法里他确实一枝独秀,进化算法有很强的灵活性,能同时处理各种各样的问题,有些问题最好的解算器也解不出来,而且很多的我们日常遇到的问题都可以放到进化算法的范畴内进行解决。

EvolutionaryAlgorithmsarealsoquiteforgiving.Theywillhappilychewonproblemsthathavebeenunder-orover-constrainedorotherwisepoorlyformulated.Furthermore,becausetherun-timeprocessisprogressive,intermediateanswerscanbeharvestedatpracticallyanytime.Unlikemanydedicatedalgorithms,EvolutionarySolversspewforthaneverendingstreamofanswers,whereneweranswersaregenerallyofahigherqualitythanolderanswers.Soevenapre-maturelyabortedrunwillyieldsomethingwhichcouldbecalledaresult.Itmightnotbeaverygoodresult,butitwillbearesultofsorts.

进化算法的容忍性也很好,他很有能力去处理一些你低估或者高估或者很傻X的操作,进一步讲,因为它运行的时候是动态的,所以你在任何时候都可以收获一大堆的解而不像其他解算法(解完了才能得到答案),进化算法射出来一大堆永远没有尽头的解,而且这一代的解总体上来说会比上一代的质量更高,所以,尽管一些早产的结果产生我们也可以姑且把他认为是结果,虽然他不是最优秀的结果,但是他确是得到最优结果必不可少的一部分。

Finally,EvolutionarySolversallow-inprinciple-forahighdegreeofinteractionwiththeuser.Thistooisafairlyuniquefeature,especiallygiventhebroadrangeofpossibleapplications.Therun-timeprocessishighlytransparentandbrowsable,andthereexistsalotofopportunityforadialoguebetweenalgorithmandhuman.Thesolvercanbecoachedacrossbarrierswiththeaidofhumanintelligence,oritcanbegoadedintoexploringsub-optimalbranchesandsuperficiallydead-ends.

最后讲一点,进化算法和用户有很强的交互性,这是非常特别独特的属性,特别是当你给了他一大堆可能的条件是。

当他在运行起来的时候,求解过程非常透明也便于浏览,因此存在很多机会创建人机交互的对话窗口,引导解算跨过障碍,或者探索一些并不是很理想的答案,甚至一条死胡同。

TheProcess

运行特点

InthissectionIshallbrieflyoutlinetheprocessofanEvolutionarySolverrun.Itisahighlysimplifiedversionoftheremainderoftheblogpost,andI'llskipovermanyinterestingandevenimportantdetails.I'llshowtheprocessasaseriesofimageframes,whereeachframeshowsthestateofthe'population'atagivenmomentintime.BeforeIcanstarthowever,Ineedtoexplainwhattheimagebelowmeans.

在这段里我将简单的介绍一下进化算法是如何运行的,这些内容都是以前一些博客简化了的,所以忽略了一些有趣甚至重要的细节。

下面我会用一系列的图片来展示他是如何运行的,每一张图都记录了在特定时刻的“代”的关系,在开始之前,我先解释一下下图是啥意思。

 

 

WhatyouseehereistheFitnessLandscapeofaparticularmodel.Themodelcontainstwovariables,meaningtwovalueswhichareallowedtochange.InEvolutionaryComputingwerefertovariablesasgenes.AswechangeGeneA,thestateofthemodelchangesanditeitherbecomesbetterorworse(dependingonwhatwe'relookingfor).SoasGeneAchanges,thefitnessoftheentiremodelgoesupordown.ButforeveryvalueofA,wecanalsovaryGeneB,resultinginbetterorworsecombinationsofAandB.EverycombinationofAandBresultsinaparticularfitness,andthisfitnessisexpressedastheheightoftheFitnessLandscape.Itisthejobofthesolvertofindthehighestpeakinthislandscape.

你可以把上面这张图当成一个特别的景观模型(类似于山脉),这个模型包涵了两个变量,他们可以同时变化。

在进化算法中我们习惯把变量称为基因。

当我们改变基因A的时候结果会变好或者变坏(取决于我们希望他变好还是变坏)来匹配适合模型的状态。

所以,当基因A改变时,整个模型都在变化。

同理,在基因A发生变化时,基因B也可以同时参与变化,这时候出来的结果就是A和B同时起的作用。

每一个A和B所产生出来的结果都被反映在这个模型的Z轴高度上,因为我们的任务就是找出来这个山峰的最高点。

Ofcoursealotofproblemsaredefinedbynotjusttwobutmanygenes,inwhichcasewecannolongerspeakofa'landscape'inthestrictsense.Amodelwith12geneswouldbea12-dimensionalfitnessvolumedeformedin13dimensionsinsteadofatwo-dimensionalfitnessplanedeformedin3dimensions.AsthisisimpossibletovisualizeIshallonlyuseoneandtwo-dimensionalmodels,butnotethatwhenwespeakofa"landscape",itmightmeansomethingterriblymorecomplexthantheaboveimageshows.

诚然,大量的问题并非简单的通过两个基因就能确定,而是需要很多基因,所以严格意义上来讲的话也就不能用景观(山脉)这个概念来解释,你想想看,一个用12个变量确定的将会是一个12维体扭曲在13维空间里,而不再是2维平面扭曲在三维空间里。

所以我用一个2维的模型是不可能展示出来12维物体的,不过我提到这个只是想说有时候我们研究的要比上面这个2维世界的图复杂得多。

Asthesolverstartsithasnoideaabouttheactualshapeofthefitnesslandscape.Indeed,ifweknewtheshapewewouldn'tneedtobotherwithallthismessyevolutionarystuffinthefirstplace.Sotheinitialstepofthesolveristopopulatethelandscape(or"model-space")witharandomcollectionofindividuals(or"genomes").Agenomeisnothingmorethanaspecificvalueforeachandeverygene.Intheabovecase,agenomecouldforexamplebe{A=0.2B=0.5}.Thesolverwillthenevaluatethefitnessforeachandeveryoneoftheserandomgenomes,givingusthefollowingdistribution:

当这个进化算法开始的时候,其实电脑是不知道这个山脉景观的,如果电脑会像我们一样一眼看出来这个山脉的高低一开始就不用这么麻烦的去弄一大堆的数据。

所以,在一开始,电脑就要用一大堆随机的点(基因组)来给他塑形。

基因组就是一组数据,没别的,在这个例子里,一个基因组就相当于A=0.2B=0.5的一个坐标。

电脑计算过每一个随机的基因组,并且适应化之后,我们就可以看到下图这样的分布。

Onceweknowhowfiteverygenomeis(i.e.,theelevationofthereddots),wecanmakeahierarchyfromfittesttolamest.Wearelookingforhigh-groundinthelandscapeanditisareasonableassumptionthatthehighergenomesareclosertopotentialhigh-groundthanthelowones.Thereforewecankillofftheworstperformingonesandfocusontheremainder:

一旦我们知道了这些基因组(下图这些抬高的红点点)匹配这个山脉的程度,我们就可以通过匹配的程度,非常匹配或者差一些的,来给他们分级。

我们是在寻找这个山脉上位置较高的点,所以有充足的理由来假设这些位置较高的基因组要比位置靠下的基因组更加接近顶端,所以,我们可以把那些表现的差一些的拖出去斩了而只关注那些剩下来的优秀的。

 

Itisnotgoodenoughtosimplypickthebestperforminggenomefromtheinitialpopulationandcallitquits.SinceallthegenomesinGeneration0werepickedatrandom,itisactuallyquiteunlikelythatanyofthemwillhavehitthejack-pot.WhatweneedtodoisbreedthebestperforminggenomesinGeneration0tocreateGeneration1.Whenwebreedtwogenomes,theiroffspringwillendupsomewhereintheintermediatemod

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 经管营销

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1