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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cross.cc

?? 用C++編寫的遺傳算法
?? CC
字號:
// cross.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------------------------------------------------------------------- */// Crosses two gps together to produce two resulting children#include <stdlib.h>#include "gp.h"// Returns a random gene selected by random number generator.// Obviously it is quite important to know the length of the GP before// calling this function.  This also adds a component laid down by// Koza that there will be a 90% chance of getting a function.  This// is produced by going through a loop 10 times and returning ONLY if// a function is found.  This should give a greater chance of getting// a function.  Note that if you have a single node this function will// not hang.// This function is useful for crossover.  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 crossover// very simple, as only pointers are swapped.  The object this// function is called for is of no importance.GPGene** GPGene::choose (GPGene** rootPtr){  GPGene **pg=NULL;  // Calculate the length of the subtree starting at the given gene  int totalLength=(**rootPtr).length ();#if GPINTERNALCHECK  if (totalLength==0)    GPExitSystem ("GPGene::choose", 		  "Tree length is 0: Can't select crossover point");#endif  // loop 10 times  for (int i=0; i<10; i++)    {      // Calculate a random number between 1..totalLength      int iLengthCount = (GPrand() % totalLength) + 1;      // Find gene with this value      pg=findNthNode (rootPtr, 0, iLengthCount);#if GPINTERNALCHECK      if (!pg)	GPExitSystem ("GPGene::choose", "Didn't find tree node");#endif      // If this pointer points to a function rather than terminal      // return this value else keep going around the loop      if ((**pg).isFunction ()) 	return pg;    }  // If after 10 loops still don't have function well return terminal  return pg;}// Cross the objects contained in the given container.  The function// is responsible for the given container and has to delete it, if a// completely new container is returned.  We use only the objects in// the container for the crossover operation, and not the object for// which we were called (though this is in our case a member of the// container).  We can use all container objects and do with them what// we want.  We only have to return another container.  The returned// container needn't contain any objects, but definitely should at// least sometimes, otherwise an infinite loop will occur, because the// generate-function tries to fill the new population with new// members, and if we return none, well...GPContainer& GP::cross (GPContainer* parents, 			int maxdepthforcrossover){#if GPINTERNALCHECK  // We are conservative: Only two sexes allowed  if (parents->containerSize()!=2)    GPExitSystem ("GP::cross", "Only two parents allowed for crossover");#endif  // Get pointers of mum and dad from container  GP& dad=*(GP*)parents->Nth (0);  GP& mum=*(GP*)parents->Nth (1);#if GPINTERNALCHECK  // GP's certainly must have the same number of trees  if (dad.containerSize()!=mum.containerSize())    GPExitSystem ("GP::cross", 		  "Mum and Dad must have same number of trees");  if (dad.containerSize()==0)    GPExitSystem ("GP::cross", "Parents contain no trees");#endif  // Work out which adf branch we are going to cut from  int randTree=GPrand() % dad.containerSize();  // Get the adresses of the pointers to the root genes of the ADF  // branch we are going to cut from  GPGene** rootGene1=(GPGene**) dad.getPointerAddress (randTree);  GPGene** rootGene2=(GPGene**) mum.getPointerAddress (randTree);#if GPINTERNALCHECK  if (!*rootGene1 || !*rootGene2)    GPExitSystem ("GP::cross", 		  "Genetic tree of Mum or Dad is NULL");#endif  // Loop around this as long as we find two points on the trees so  // that the maxdepthforcrossover is not exceeded  int maxDepth1, maxDepth2;  do    {      // Determine the cut points by choosing a node within mum and      // dad      GPGene** cutPoint1=(**rootGene1).choose (rootGene1);      GPGene** cutPoint2=(**rootGene2).choose (rootGene2);      // Swap the whole subtrees.  Easy, isn't it? And so fast...      GPGene* tmp=*cutPoint1;      *cutPoint1=*cutPoint2;      *cutPoint2=tmp;      // Here the maximum depth of the new trees and only that trees      // is calculated as other trees we assume to be under the      // maximum depth of crossover      maxDepth1=(**rootGene1).depth ();      maxDepth2=(**rootGene2).depth ();      // Make sure that maximum depth is not too high.  If so, swap      // the subtrees back      if (maxDepth1>maxdepthforcrossover || maxDepth2>maxdepthforcrossover)	{ 	  tmp=*cutPoint1;	  *cutPoint1=*cutPoint2;	  *cutPoint2=tmp;	}    }  while (maxDepth1>maxdepthforcrossover || maxDepth2>maxdepthforcrossover);  // After crossover, the fitness of the GP is no longer valid, so we  // set the corresponding flag.  The length and depth has to be  // recalculated as well.  dad.fitnessValid=0;  mum.fitnessValid=0;  dad.calcLength();  dad.calcDepth();  mum.calcLength();  mum.calcDepth();  // We return the same container, so we don't have to allocate a new  // one and delete the parents container  return *parents;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区视频在线看| 悠悠色在线精品| 欧美一区二区视频观看视频| 欧美日本在线看| 欧美在线观看视频一区二区三区| 国产在线精品免费| 经典三级在线一区| 国产揄拍国内精品对白| 国产一二三精品| 欧美日韩在线亚洲一区蜜芽| av电影天堂一区二区在线观看| 国产大陆精品国产| 国产成人免费在线观看| 成人听书哪个软件好| 波多野结衣在线aⅴ中文字幕不卡| 国产成人免费视频| av在线播放一区二区三区| 成人18视频在线播放| 91美女在线看| 欧美日本一区二区在线观看| 欧美一区二区视频在线观看2022| 欧美成人午夜电影| 久久新电视剧免费观看| 欧美国产日韩亚洲一区| ...xxx性欧美| 一区二区三区波多野结衣在线观看| 亚洲午夜一二三区视频| 日本最新不卡在线| 黑人精品欧美一区二区蜜桃| 成人精品视频一区| 色哟哟在线观看一区二区三区| 欧美日韩免费一区二区三区视频 | 亚洲免费在线观看视频| 久久先锋影音av鲁色资源网| 国产精品视频麻豆| 亚洲精品一二三区| 日本视频中文字幕一区二区三区| 极品美女销魂一区二区三区| 99精品久久久久久| 51午夜精品国产| 久久久高清一区二区三区| 亚洲欧美激情插| 麻豆国产欧美日韩综合精品二区| 国产成人av电影免费在线观看| 色婷婷综合视频在线观看| 日韩一区二区三区在线| 中文在线资源观看网站视频免费不卡| 亚洲精品网站在线观看| 捆绑调教美女网站视频一区| 99久久精品国产毛片| 制服丝袜av成人在线看| 国产精品毛片大码女人| 首页国产欧美久久| 播五月开心婷婷综合| 欧美一二区视频| 亚洲欧美国产77777| 精品制服美女丁香| 色婷婷亚洲精品| 风间由美一区二区av101| 久久一留热品黄| 亚洲欧美一区二区久久| 麻豆精品一区二区三区| 99视频超级精品| 精品国产制服丝袜高跟| 一二三区精品福利视频| 精一区二区三区| 欧美日韩在线一区二区| 中文字幕在线免费不卡| 久久99精品网久久| 欧美日韩精品免费观看视频| 国产精品午夜久久| 国内精品伊人久久久久av一坑| 在线观看一区二区精品视频| 国产喷白浆一区二区三区| 免费成人在线网站| 欧美日韩中文字幕一区| 中文字幕高清不卡| 久久不见久久见中文字幕免费| 在线观看国产一区二区| 中文字幕色av一区二区三区| 国产一区二区在线影院| 欧美久久高跟鞋激| 一区二区三区在线视频播放| 成人做爰69片免费看网站| 亚洲国产精品二十页| 欧美丰满少妇xxxxx高潮对白 | 亚洲成av人片在线观看| 东方aⅴ免费观看久久av| 2021国产精品久久精品| 久久精工是国产品牌吗| 欧美丰满嫩嫩电影| 亚洲电影在线播放| 在线观看免费视频综合| 一区二区三区在线观看欧美| 97精品电影院| 国产精品不卡视频| 成人晚上爱看视频| 国产精品免费久久| 成人激情小说网站| 国产精品网站一区| 成人白浆超碰人人人人| 国产精品久久久99| 99国产精品一区| 中文字幕日韩一区| 一本色道**综合亚洲精品蜜桃冫| 国产精品三级av| 北岛玲一区二区三区四区| 国产精品麻豆一区二区| 99视频一区二区三区| 亚洲人亚洲人成电影网站色| 色猫猫国产区一区二在线视频| 亚洲少妇中出一区| 亚洲乱码国产乱码精品精98午夜 | 自拍视频在线观看一区二区| 99视频一区二区| 亚洲男同1069视频| 欧美主播一区二区三区| 亚洲成人免费av| 欧美二区在线观看| 另类小说图片综合网| 久久婷婷综合激情| 风间由美一区二区三区在线观看| 国产精品久久久久9999吃药| 91在线一区二区三区| 亚洲综合久久久| 91精品黄色片免费大全| 裸体在线国模精品偷拍| 久久综合色综合88| 99久久精品国产一区| 亚洲一区二区视频在线| 日韩一区二区免费在线电影| 国产美女娇喘av呻吟久久| 中文字幕一区二区三区四区不卡 | 中文字幕不卡在线播放| 91视频91自| 一区二区在线观看免费 | 性做久久久久久免费观看| 在线播放/欧美激情| 黑人巨大精品欧美一区| 中文字幕亚洲一区二区va在线| 91精彩视频在线| 捆绑调教美女网站视频一区| 日本一区二区三区在线不卡| 色狠狠一区二区三区香蕉| 日本欧美大码aⅴ在线播放| 久久综合999| 色综合 综合色| 精品午夜久久福利影院| 中文字幕一区二区三区蜜月| 欧美疯狂性受xxxxx喷水图片| 国产乱码精品一区二区三区av| 亚洲欧美一区二区三区孕妇| 日韩一二在线观看| 99re6这里只有精品视频在线观看| 亚洲成在线观看| 国产色产综合产在线视频| 欧洲一区在线观看| 国产酒店精品激情| 亚洲成人午夜电影| 亚洲国产成人午夜在线一区| 717成人午夜免费福利电影| 福利一区福利二区| 日韩中文字幕不卡| 国产精品久久久99| 欧美电影免费观看高清完整版在线| www.欧美日韩| 欧美性色黄大片| 欧美系列亚洲系列| 韩国av一区二区三区| 亚洲一区二区影院| 91视频免费观看| 秋霞午夜av一区二区三区| 国产精品视频在线看| 欧美电影免费提供在线观看| 91免费观看在线| 国产成人综合网站| 免费成人小视频| 亚洲va欧美va人人爽午夜| 国产精品美女久久久久av爽李琼 | 久久久久久亚洲综合| 欧美精品日韩一本| 91官网在线观看| 成人在线视频首页| 最新久久zyz资源站| 久久国产剧场电影| 五月激情综合色| 伊人性伊人情综合网| 欧美国产日韩一二三区| 久久综合色一综合色88| 日韩一区二区三区在线观看| 91丨porny丨在线| 国产成人精品综合在线观看 | 欧美精品自拍偷拍| 亚洲mv在线观看| 国产精品的网站| ww亚洲ww在线观看国产| 欧美日韩高清不卡| 欧美精品自拍偷拍动漫精品| 97久久久精品综合88久久| 国内精品写真在线观看|