亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? mutate.cc

?? 用C++編寫的遺傳算法
?? CC
字號:
// mutate.cc/* -------------------------------------------------------------------gpc++ - The Genetic Programming KernelThis program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 1, or (at your option)any later version.This program is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.Copyright 1993, 1994 Adam P. Fraser and 1996, 1997 Thomas WeinbrennerFor comments, improvements, additions (or even money) contact:Thomas WeinbrennerGrauensteinstr. 2635789 LaimbachGermanyE-mail: thomasw@emk.e-technik.th-darmstadt.deWWW:    http://www.emk.e-technik.th-darmstadt/~thomasw  or (Address may be out of date)Adam Fraser, Postgraduate Section, Dept of Elec & Elec Eng,Maxwell Building, University Of Salford, Salford, M5 4WT, United Kingdom.E-mail: a.fraser@eee.salford.ac.ukTel:    (UK) 061 745 5000 x3633Fax:    (UK) 061 745 5999------------------------------------------------------------------- */#include <stdio.h>#include "gp.h"// Swap mutation: Number of trials to find a node with same number of// arguments, but different node value.const int swapAttempts=5;// This block of code perform allele or swap mutation on a genetic// program.  This comprised of code being swapped with other code with// certain constraints.  Any terminal can be swapped with any other// but functions can only be swapped with other functions with the// same arguments.  This means that the mutation does not have to// create new branches when different function types are swapped which// seems implicitly wrongvoid GP::swapMutation (GPAdfNodeSet& adfNs){#if GPINTERNALCHECK  if (containerSize()==0)    GPExitSystem ("GP::swapMutation", "GP contains no trees");#endif  // Point to a particular adf genetic tree and get that node set for  // that tree.    int randtree = GPrand() % containerSize ();  GPNodeSet& ns=*adfNs.NthNodeSet (randtree);  GPGene* rootGene=NthGene (randtree);  if (rootGene)    {      // Select a gene on that branch, e.g. get the address of the      // pointer that points to the gene      GPGene& g=**(rootGene->		   choose ((GPGene**)getPointerAddress (randtree)));        // First of all we have to work out how many arguments this      // function (if it is one) has.  There are two ways: Using      // containerSize() of the Gene or have a look at the node.  The      // user could have modified the number of children of a gene, so      // we don't use the node information      int args=g.containerSize ();      // Try a certain number of times to find a node with different      // node identification value than before.      for (int i=0; i<swapAttempts; i++)	{  	  // Choose a node at random from node set with the same	  // number of arguments than the gene we chose	  GPNode* node=ns.chooseNodeWithArgs (args);	  if (node)	    {	      // Check that the number of arguments match the number	      // of arguments of the function and also check that it	      // has a different identification value, little point	      // otherwise.	      if (node->value() != g.geneNode().value())		{		  // replace old function with new one and stop loop		  g.node=node;		  break;		}	    }	}    }}// Count the number of function nodes a tree hasint GPGene::countFunctions (){  // We determine whether the current gene is a function or a terminal  // by the number of children the node has  int count=(containerSize()>0) ? 1 : 0;  // Loop through the children  GPGene* gene;  for (int n=0; n<containerSize(); n++)    if ((gene=NthChild (n)))      count+=gene->countFunctions ();  return count;}// Returns a random function(!) gene selected by random number// generator.  Obviously it is quite important to know the number of// functions, which is evaluated using countFunctions().  This// function here is useful for shrink mutation.  The parameter is the// adress of a pointer that refers to the root gene.  We also return// the adress of a pointer to the selected gene.  This makes the// shrink mutation very simple.  The object this function is called// for is of no importance, but is usually the root gene.  The// function returns NULL if no function nodes exists.GPGene** GPGene::chooseFunctionNode (GPGene** rootPtr){  // Calculate the length of the subtree starting at the given gene  // and calculate a random number between 1 -> totalFunctions  int totalFunctions=(**rootPtr).countFunctions ();  if (totalFunctions>0)    {      int randomFunc = (GPrand() % totalFunctions) + 1;      // Find function gene      GPGene **pg=findNthNode (rootPtr, 1, randomFunc);#if GPINTERNALCHECK      if (!pg)	GPExitSystem ("GPGene::chooseFunctionNode", 		      "Didn't find tree node");#endif      // Return function node      return pg;    }  else     return NULL;}// This block of code performs shrink mutation on a genetic program.// A function node is chosen by random from a random GP tree, and one// of the children of the function takes the position of the parent.void GP::shrinkMutation (){#if GPINTERNALCHECK  if (containerSize()==0)    GPExitSystem ("GP::swapMutation", "GP contains no trees");#endif  // Select a particular adf genetic tree by random  int randtree = GPrand() % containerSize ();  // Get root gene  GPGene* rootGene=NthGene (randtree);  if (rootGene)    {      // Select a function gene on that branch, e.g. get the address      // of the pointer that points to the gene.      GPGene** rootGenePtr=(GPGene**)getPointerAddress (randtree);      GPGene** g=rootGene->chooseFunctionNode (rootGenePtr);      // If function node exists (it may happen that there is no      // function node at all)      if (g)	{	  // Choose one subtree (or child) of the chosen function gene	  int subTree=GPrand() % (**g).containerSize();	  GPGene* child=(**g).NthChild (subTree);	  // Set the pointer the parent uses to point to the child to	  // NULL, so that the child won't be deleted if the parent is	  // killed.	  GPGene** childPtr=(GPGene**) (**g).getPointerAddress (subTree);	  *childPtr=NULL;	  // Delete parent.	  delete *g;      	  // Put the child on the position of the former parent	  *g=child;	  // Recalculate length and depth	  calcLength ();	  calcDepth ();	}    }}// Mutate the GP with the probability given by parameter in the// GPVariables.  void GP::mutate (GPVariables& GPVar, GPAdfNodeSet& adfNs){  if (GPRandomPercent (GPVar.SwapMutationProbability))    {      swapMutation (adfNs);      fitnessValid=0;    }  if (GPRandomPercent (GPVar.ShrinkMutationProbability))    {      shrinkMutation ();      fitnessValid=0;    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美年轻男男videosbes| 日韩va欧美va亚洲va久久| 国产a级毛片一区| 26uuu精品一区二区在线观看| 久久精品av麻豆的观看方式| 久久亚洲精华国产精华液| 国产在线视频一区二区| 亚洲国产成人一区二区三区| www.久久精品| 亚洲自拍欧美精品| 7777精品伊人久久久大香线蕉经典版下载 | 欧美日本韩国一区| 蜜臀99久久精品久久久久久软件| 欧美r级在线观看| 成人午夜视频在线| 亚洲午夜羞羞片| 日韩欧美久久一区| av欧美精品.com| 午夜电影网一区| 国产欧美日韩卡一| 欧美日韩在线播放三区四区| 精品一区二区免费看| 国产精品成人免费| 欧美丰满美乳xxx高潮www| 激情综合网最新| 亚洲欧美二区三区| 欧美sm美女调教| 在线精品观看国产| 九色综合国产一区二区三区| 国产精品国产三级国产aⅴ原创| 日本久久一区二区三区| 国内成人免费视频| 亚洲一区二区三区免费视频| 精品国产亚洲在线| 色偷偷成人一区二区三区91| 韩国女主播一区二区三区| 伊人色综合久久天天人手人婷| 欧美va亚洲va| 欧美吻胸吃奶大尺度电影| 高清不卡一区二区| 日韩精品成人一区二区三区| 国产精品青草久久| 欧美一卡二卡三卡| 在线亚洲一区二区| 国产成人精品www牛牛影视| 日韩在线a电影| 一区二区三区在线视频观看| 国产亚洲制服色| 欧美一级免费观看| 欧洲精品一区二区三区在线观看| 风间由美一区二区三区在线观看 | 在线免费视频一区二区| 国产不卡在线视频| 男人的天堂亚洲一区| 亚洲精品国产一区二区精华液| 精品久久久久久久久久久久久久久久久| 在线免费观看成人短视频| 成人精品国产一区二区4080| 国内成人免费视频| 九九九久久久精品| 蜜臂av日日欢夜夜爽一区| 亚洲.国产.中文慕字在线| 亚洲欧美激情视频在线观看一区二区三区| 久久久亚洲精品石原莉奈| 日韩欧美亚洲一区二区| 欧美精品tushy高清| 欧美自拍偷拍一区| 91高清视频在线| 色婷婷综合久久久久中文一区二区| 成人精品免费视频| 成年人国产精品| av午夜精品一区二区三区| 成人免费黄色在线| 成人免费高清视频在线观看| 国产精品一品二品| 国产成都精品91一区二区三| 国产成人av福利| 国产成人av电影在线观看| 风间由美中文字幕在线看视频国产欧美| 国产一区二区久久| 粉嫩av一区二区三区粉嫩| 成人av在线播放网址| a在线欧美一区| 日本高清不卡在线观看| 欧美色综合久久| 欧美日韩国产美女| 日韩一区二区三区四区五区六区| 91精品国产色综合久久不卡蜜臀| 91精品国产91久久久久久最新毛片 | 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 欧美吻胸吃奶大尺度电影 | 一区二区欧美视频| 亚洲国产视频a| 首页亚洲欧美制服丝腿| 日韩综合小视频| 国产一区二区看久久| a美女胸又www黄视频久久| 欧美亚洲综合在线| 日韩一区二区三区四区| 国产亚洲成av人在线观看导航| 国产精品久久久久精k8| 一区二区免费在线| 美国十次综合导航| 成人一级片网址| 在线观看亚洲成人| 欧美www视频| 中文字幕视频一区| 日韩二区三区四区| 丁香天五香天堂综合| 欧洲一区在线观看| 精品国产乱码久久久久久影片| 国产精品免费久久| 午夜电影网亚洲视频| 国产成人8x视频一区二区| 欧美在线观看一二区| 精品国产sm最大网站免费看| 亚洲欧美日韩国产综合| 捆绑调教一区二区三区| 色综合色狠狠天天综合色| 91精品国产91久久久久久最新毛片 | 国产精品美女久久久久av爽李琼| 一区二区日韩av| 国产精品亚洲а∨天堂免在线| 色婷婷精品久久二区二区蜜臂av| 日韩美一区二区三区| 悠悠色在线精品| 国产精品乡下勾搭老头1| 欧美吻胸吃奶大尺度电影| 国产日韩欧美制服另类| 三级在线观看一区二区| 成人午夜电影久久影院| 欧美精品视频www在线观看 | 日韩欧美一级二级三级久久久| 亚洲天堂成人在线观看| 国产美女久久久久| 欧美网站大全在线观看| 日本一二三不卡| 老司机午夜精品| 欧美性videosxxxxx| 国产精品电影一区二区| 国产一区二区三区在线观看精品 | 欧美丝袜丝交足nylons图片| 国产精品网站一区| 久久电影网电视剧免费观看| 欧美日韩在线播放一区| 亚洲猫色日本管| 国产91精品在线观看| 久久综合九色综合97_久久久| 亚洲国产中文字幕| 91猫先生在线| 国产精品色一区二区三区| 国产一区二区三区日韩 | 国产乱理伦片在线观看夜一区| 在线看国产一区二区| 成人欧美一区二区三区小说 | 九色综合狠狠综合久久| 欧美人xxxx| 亚洲成人黄色小说| 欧美亚洲免费在线一区| 一区二区三区在线免费观看| 91丨porny丨国产入口| 国产精品美女久久久久aⅴ国产馆| 国产中文一区二区三区| 精品国产区一区| 精品一区二区三区日韩| 日韩一区国产二区欧美三区| 日韩电影在线一区二区三区| 欧美美女一区二区在线观看| 五月天亚洲精品| 欧美高清视频在线高清观看mv色露露十八| 一区二区三区四区精品在线视频| 日本久久一区二区| 亚洲午夜久久久久久久久电影院| 欧美亚一区二区| 日韩中文字幕不卡| 欧美一区二区高清| 国内精品久久久久影院色| 久久久久九九视频| 成人国产精品免费观看| 一区二区在线电影| 欧美日韩精品一区二区三区四区| 日韩精品免费视频人成| 欧美成人免费网站| 成人性生交大片免费看中文 | 久久久久一区二区三区四区| 风流少妇一区二区| 亚洲欧美另类小说| 3d成人h动漫网站入口| 极品少妇xxxx精品少妇偷拍| 欧美激情中文不卡| 91高清在线观看| 日本女优在线视频一区二区| 久久久三级国产网站| eeuss影院一区二区三区| 一区二区三区色| 欧美videossexotv100| 国产999精品久久久久久绿帽| 亚洲精品视频一区二区| 91精品国产色综合久久ai换脸| 极品少妇一区二区|