您好,欢迎访问三七文档
2vv3vDarwinMendelvDarwinvMendel4v5vDNADNADNA3.16vgenenucleotide4thymineadeninecytocineguanineTACGallelelocus7vvcollectiondonor8vrecombinationcrossover9v10vv11“”12vv135.1.1vSGAvvv14vvv(),15v[AB]AB,l.00000000……00000000=0--A00000000……00000001=1--A+……………………………………..11111111……11111111=2l-1——Bl2⎪⎭⎪⎬⎫12--=lABd16vXxlxl-1xl-2…x2x1v11221liiliBAxAb-=-=+•-∑17vvv18v{ABCD…}{12345…}{x1x2x3x4x5…}vTSP134567829134567829119vfitnessfunctionTSPTSP20v:v(selection)reproductionv(crossover)v(mutation)21vvfifiififi22vP1P21000111011011001P1P210001001Q111011110Q223v101001101011011024(1);(2);(3);(4)Pc;(5)Pm;(6)(2)(7)25vv[015]2()log(1)fxx=+••4•4•Pc=0.6•Pm=0.1526vZttf*f(x)XZtvP{Zt=f*}=1vlim∞→t27v28(2);(3)(4);(5)Pc;(6)Pm;(7)(8)(2)291vv[015]2()log(1)fxx=+••4•4•Pc=0.6•Pm=0.1530v,;v,;,31::,,.:Pc60~100%.:Pm0.1~10%32(1)(2)(3)(4)33vvvvv34v123Davison-Fletcher-Powell35v1)v2)v336Bobv“”BobBobv015837{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,1,1,1,0,0,0,1,1,0,1,0,0,0,0,0,1,1,1,0,0,0,1,8,0,0,0,0,0,0,0,1,1,1,0,0,0,1,8,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,0,0,0,1,1,1,0,0,1,0,0,0,0,1,1,0,0,0,1,1,1,0,0,1,0,0,0,0,1,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,1,0,0,0,1,1,1,0,0,0,0,0,1,0,1,1,1,0,0,1,1,1,0,0,0,0,0,1,0,1,1,1,0,0,1,1,1,0,0,0,0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,1,1,1,0,1,1,0,0,0,0,1,0,0,0,0,1,1,1,0,1,1,0,1,1,0,0,0,1,0,0,0,0,0,0,5,1,0,1,1,0,0,0,1,0,0,0,0,0,0,5,1,0,1,1,0,0,0,1,0,0,0,0,0,0,1,1,0,1,1,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}3839vCBobsMapclassCbobsMap{private://(2)staticconstintmap[MAP_HEIGHT][MAP_WIDTH];staticconstintm_iMapWidth;//staticconstintm_IMapHelght;////staticconstintm_iStartX;staticconstintm_iStartY;//staticconstintm_iEndX;staticconstintm_iEndY;public://,BobIntmemory[MAP_HEIGHT][MAP_WIDTH];CBobsMap(){ResetMemory();}//Bob,Bob//Bob,doubleTestRoute(constvectorint&vecPath,CBobsMap&memory);//RenderWindowsGDIvoidRender(constintcxClient,constintcyClient,HDCsurface);//voidMemoryRender(constintcxClient,constintcyClient.HDCsurface);voidResetMemory();};40vBobBob44431121010100041vBob111110011011101110010101v11,11,10,01,10,11,10,11,10,01,01,01v3,3,2,1,2,3,2,3,2,1,1,142South101South101South101East210West311East210West311East210South101East210West311West31143vSGenomestructSgenome{vectorintvecBits;doubledFitness;SGenome():dFitness(0){}SGenome(constintnum_bits):dFitness(0){//for(inti=0;inum_bits;++i){vecBits.push_back(RandInt(0,1));}}};44(vEpoch()vEpoch45vdefines.h0.70.001246v————v1472vv4referenceparentstd::vector2483vm_dMutationRatevoidCgaBob::Mutate(vectorint&vecBits){for(intcurBit=0;curBitvecBits.size();curBit++){//?If(RandFloat()m_dMutationRate)(vecBits[curBit]=!vecBits[curBit];)}//}49v----vvvvv,.
本文标题:人工智能-遗传算法
链接地址:https://www.777doc.com/doc-6111619 .html