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

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

?? selection.c

?? 一個完整的C語言遺傳程序包
?? C
字號:
/*SGPC: Simple Genetic Programming in C(c) 1993 by Walter Alden Tackett and Aviram Carmi  This code and documentation is copyrighted and is not in the public domain. All rights reserved.   - This notice may not be removed or altered.  - You may not try to make money by distributing the package or by using the   process that the code creates.  - You may not distribute modified versions without clearly documenting your   changes and notifying the principal author.  - The origin of this software must not be misrepresented, either by   explicit claim or by omission.  Since few users ever read sources,   credits must appear in the documentation.  - Altered versions must be plainly marked as such, and must not be   misrepresented as being the original software.  Since few users ever read   sources, credits must appear in the documentation.  - The authors are not responsible for the consequences of use of this    software, no matter how awful, even if they arise from flaws in it. If you make changes to the code, or have suggestions for changes,let us know!  (gpc@ipld01.hac.com)*/#ifndef lintstatic char selection_c_rcsid[]="$Id: selection.c,v 2.7 1993/05/29 22:59:21 gpc-avc Exp gpc-avc $";#endif/* * * $Log: selection.c,v $ * Revision 2.7  1993/05/29  22:59:21  gpc-avc * use M_PI from math.h instead of PI from gpc.h * * Revision 2.6  1993/04/22  07:39:12  gpc-avc * Removed old log messages * * Revision 2.5  1993/04/14  04:50:16  gpc-avc * just a change of the revision number * * */#include <stdio.h>#include <malloc.h>#include <errno.h>#include <math.h>#include "gpc.h"#ifdef ANSI_FUNCtree *find_tree(  pop_struct 	*pop,  int 		p,  int 		demes,  int 		nrows,  int 		ncols,  int		*worst,  int		*best  )#elsetree *find_tree(pop,p,demes,nrows,ncols,worst,best)  pop_struct	*pop;  int		p;  int 		demes;  int 		nrows;  int 		ncols;  int		*worst;  int		*best;#endif{  if (demes) {    return find_tree_using_demes(pop,p,nrows,ncols,worst,best);  } else {    switch (pop[p].selection_method) {    case TOURNAMENT:      return find_tree_using_tournament(pop,p,worst,best);    case OVERSELECT:      return 	find_tree_using_fitnessprop(pop,p,random_float_with_overselect(pop,p));    case FITNESSPROP:      return find_tree_using_fitnessprop(pop,p,random_float(1.0));    default:      fprintf(stderr,"Invalid selection method %d\n",pop[p].selection_method);      return (NULL);    }  }}#ifdef ANSI_FUNCtree *find_tree_using_demes(  pop_struct 	*pop,  int 		p,  int 		nrows,  int 		ncols,  int		*worst,  int		*best  )#elsetree *find_tree_using_demes(pop,p,nrows,ncols,worst,best)  pop_struct	*pop;  int		p;  int 		nrows;  int 		ncols;  int		*worst;  int		*best;#endif{  int   i,row,col;  int	best_index, best_i, worst_index;  /* Select tournament_K individuals */  for (i = 0; i < pop[p].tournament_K; i++) {    pop[p].tournament_index[i] =      cannonical_select(pop,p,nrows,ncols);#if DBDEMES == 1    printf(" %d (LID=%d, SF=%f)\n", i, pop[p].tournament_index[i],	   POP[p].standardized_fitness[pop[p].tournament_index[i]]);#endif  }  /* Find fitest individual */  best_index = worst_index = pop[p].tournament_index[best_i=0];  for (i = 1; i < pop[p].tournament_K; i++) {    if (POP[p].standardized_fitness[pop[p].tournament_index[i]] <	POP[p].standardized_fitness[best_index]) {      best_index = pop[p].tournament_index[i];      best_i = i;    }    if (POP[p].standardized_fitness[pop[p].tournament_index[i]] >=	POP[p].standardized_fitness[worst_index]) {      worst_index = pop[p].tournament_index[i];    }  }#if DBDEMES == 1  printf(" %d WON (linear id=%d)\n", best_i, best_index);#endif  *best = best_index;  *worst = worst_index;  return POP[p].population[best_index];}#ifdef ANSI_FUNCint cannonical_select (  pop_struct 	*pop,  int 		p,  int 		nrows,  int 		ncols  )#elseint cannonical_select(pop,p,nrows,ncols)  pop_struct	*pop;  int		p;  int 		nrows;  int 		ncols;#endif{  float		azimuth, range, x, y;  int		row,col,individual_id;  azimuth = random_float(2.0*M_PI);  range = gaussian_noise(0.0, pop[p].deme_search_radius_sigma);  x = (0.5+(float)(pop[p].my_col)) + range * (float) cos((double)azimuth);  y = (0.5+(float)(pop[p].my_row)) + range * (float) sin((double)azimuth);  if (x<0.0) x+= (float) ncols;  if (y<0.0) y+= (float) nrows;  col = ((int) x)%ncols;  row = ((int) y)%nrows;  individual_id = random_int(pop[p].population_size);#if DBDEMES == 1  printf("select id %d from row %d col %d for tournament slot",	 individual_id, row, col);#endif  return ((row*ncols) + col)*pop[p].population_size + individual_id;}#ifdef ANSI_FUNCfloat random_float_with_overselect(  pop_struct 	*pop,  int 		p  )#elsefloat random_float_with_overselect(pop,p)  pop_struct	*pop;  int		p;#endif{  float	boundary;  if (pop[p].population_size < 1000) {    fprintf(stderr,"population size %d is too small for overselection\n",	    pop[p].population_size);    exit(-1);  }  boundary = 320.0 / (float) (pop[p].population_size);  if (random_float(1.0) < 0.8) {    return random_float(1.0);  } else {    return (boundary + random_float(1.0-boundary));  }}#ifdef ANSI_FUNCtree *find_tree_using_tournament_2(  pop_struct	*pop,  int 		p  )#elsetree *find_tree_using_tournament_2(pop,p)  pop_struct 	*pop;  int		p;#endif{  int	index1, index2;  index1 = random_int(pop[p].population_size);  index2 = random_int(pop[p].population_size);  if (pop[p].standardized_fitness[index1] <      pop[p].standardized_fitness[index2])    return pop[p].population[index1];  else    return pop[p].population[index2];}#ifdef ANSI_FUNCtree *find_tree_using_tournament(  pop_struct 	*pop,  int 		p,  int		*worst,  int		*best  )#elsetree *find_tree_using_tournament(pop,p,worst,best)  pop_struct	*pop;  int		p;  int		*worst;  int		*best;#endif{  int   i;  int	best_fitness_index;  int	worst_fitness_index;  /* Select tournament_K individuals */  for (i = 0; i < pop[p].tournament_K; i++) {    pop[p].tournament_index[i] = random_int(pop[p].population_size);  }  /* Find fitest individual */  best_fitness_index = worst_fitness_index = pop[p].tournament_index[0];  for (i = 1; i < pop[p].tournament_K; i++) {    if (pop[p].standardized_fitness[pop[p].tournament_index[i]] <	pop[p].standardized_fitness[best_fitness_index]) {      best_fitness_index = pop[p].tournament_index[i];    }    if (pop[p].standardized_fitness[pop[p].tournament_index[i]] >=	pop[p].standardized_fitness[worst_fitness_index]) {      worst_fitness_index = pop[p].tournament_index[i];    }  }  *best = best_fitness_index;  *worst = worst_fitness_index;  return pop[p].population[best_fitness_index];}#ifdef ANSI_FUNCtree *find_tree_using_fitnessprop(  pop_struct 	*pop,  int 		p,  float 	thresh  )#elsetree *find_tree_using_fitnessprop(pop, p, thresh)  pop_struct	*pop;  int		p;  float		thresh;#endif{  int	i;  float	sum;  int	worst_index;  for (i=0, sum=0.0;       ((i<pop[p].population_size) && (sum < thresh));       sum += pop[p].normalized_fitness[pop[p].fitness_sort_index[i]], i++);  return pop[p].population[pop[p].fitness_sort_index[i-1]];}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久国产一区二区三区四区小说 | 成人国产一区二区三区精品| 欧美一级夜夜爽| 日本成人在线网站| 欧美一区二区精美| 精品影院一区二区久久久| 久久综合久久综合久久| 成人免费高清在线| 亚洲黄一区二区三区| 欧美在线观看一区二区| 日韩国产在线一| xnxx国产精品| 91影院在线观看| 视频一区视频二区中文字幕| 日韩免费高清视频| 国产99久久久国产精品| 综合久久久久久久| 欧美精品粉嫩高潮一区二区| 久久机这里只有精品| 国产精品白丝在线| 欧美色爱综合网| 九九**精品视频免费播放| 国产欧美日韩亚州综合| 91欧美激情一区二区三区成人| 亚洲国产毛片aaaaa无费看| 日韩一级黄色片| 国产盗摄精品一区二区三区在线 | 精品福利一二区| 99久久婷婷国产精品综合| 亚洲va欧美va人人爽| 久久综合久久综合亚洲| 91久久精品网| 精品一区二区免费视频| 亚洲美女一区二区三区| 日韩欧美电影一区| 91香蕉国产在线观看软件| 人人狠狠综合久久亚洲| 国产精品国产馆在线真实露脸 | 欧美一级欧美一级在线播放| 成人a免费在线看| 秋霞电影网一区二区| 欧美国产激情二区三区 | 欧美大胆一级视频| 色噜噜狠狠色综合欧洲selulu| 精品一区二区三区在线观看国产| 亚洲综合色噜噜狠狠| 国产三级一区二区| 日韩三级免费观看| 欧美性videosxxxxx| 成人18视频日本| 精品亚洲国内自在自线福利| 一区二区欧美国产| 1区2区3区欧美| 久久久久99精品一区| 91麻豆精品国产无毒不卡在线观看| 成人免费视频视频在线观看免费| 蜜桃av噜噜一区| 午夜精品久久久久久久久久久| 亚洲日本成人在线观看| 国产欧美va欧美不卡在线 | 国产三级欧美三级| 日韩午夜精品电影| 日韩欧美一区二区久久婷婷| 色吧成人激情小说| 97se狠狠狠综合亚洲狠狠| 国产精品香蕉一区二区三区| 美女一区二区视频| 日本一道高清亚洲日美韩| 亚洲国产一区视频| 一区二区三区成人| 亚洲精品第一国产综合野| 中文字幕精品—区二区四季| 国产偷国产偷亚洲高清人白洁| 日韩欧美国产不卡| 精品日韩一区二区三区免费视频| 这里只有精品视频在线观看| 欧美久久久久久久久久| 欧美日韩精品高清| 91电影在线观看| 欧美性欧美巨大黑白大战| 色噜噜狠狠色综合中国| 欧美性xxxxx极品少妇| 欧美日韩一区二区欧美激情 | 亚洲午夜久久久久久久久久久| 一区二区欧美国产| 亚洲一区av在线| 亚洲 欧美综合在线网络| 视频一区二区三区入口| 日本不卡的三区四区五区| 蜜臀av性久久久久蜜臀aⅴ流畅 | 99久久久久久| 91久久免费观看| 欧美日韩国产综合草草| 欧美理论在线播放| 日韩女优av电影在线观看| 久久久夜色精品亚洲| 国产精品丝袜一区| 亚洲一区影音先锋| 人妖欧美一区二区| 国产成人精品免费网站| av午夜精品一区二区三区| 欧美在线免费视屏| www欧美成人18+| 日韩一区欧美一区| 亚洲风情在线资源站| 久久成人综合网| 成人中文字幕在线| 欧美日韩在线电影| 精品国产成人系列| 国产精品国模大尺度视频| 亚洲午夜私人影院| 欧美中文字幕一区二区三区亚洲| 日韩欧美一区二区三区在线| 中文字幕在线不卡一区二区三区| 亚洲自拍欧美精品| 国产一区在线观看视频| 91丝袜美腿高跟国产极品老师| 欧美军同video69gay| 欧美国产在线观看| 日韩精品一卡二卡三卡四卡无卡| 国产成人在线影院| 欧美日韩不卡一区| 国产精品久久精品日日| 天天综合天天做天天综合| 丁香桃色午夜亚洲一区二区三区| 日本韩国精品一区二区在线观看| 26uuu国产在线精品一区二区| 亚洲专区一二三| 国产伦精品一区二区三区在线观看| 色88888久久久久久影院野外| 精品不卡在线视频| 亚洲成av人片观看| 成人h版在线观看| 欧美大度的电影原声| 亚洲sss视频在线视频| 成人小视频在线观看| 日韩视频中午一区| 亚洲无线码一区二区三区| caoporn国产精品| 国产夜色精品一区二区av| 日韩福利视频导航| 欧美性videosxxxxx| 亚洲欧美偷拍卡通变态| 国产成人精品一区二| 欧美xxxxx裸体时装秀| 亚洲第一搞黄网站| 色哟哟一区二区在线观看| 国产精品―色哟哟| 国产乱码精品一区二区三区忘忧草| 欧美丰满高潮xxxx喷水动漫| 亚洲欧美偷拍卡通变态| 成人涩涩免费视频| 亚洲国产精品成人久久综合一区 | 狠狠色丁香婷婷综合| 欧美日韩在线免费视频| 一区二区三区丝袜| 91在线视频观看| 亚洲日本护士毛茸茸| 91在线观看一区二区| 国产精品欧美久久久久无广告| 狠狠色狠狠色综合日日91app| 日韩免费高清av| 蜜臀av一区二区在线免费观看| 91精品国产免费| 日本vs亚洲vs韩国一区三区 | 国产精品一二三四五| 久久免费电影网| 国产suv精品一区二区6| 久久久精品综合| 国产乱码字幕精品高清av| 欧美国产乱子伦| 91在线视频免费观看| 亚洲综合色在线| 欧美精品九九99久久| 日韩av不卡在线观看| 日韩精品一区二区三区视频播放| 久久er99热精品一区二区| 日韩免费性生活视频播放| 国产乱淫av一区二区三区| 国产色综合久久| 色综合久久88色综合天天免费| 一区二区三区丝袜| 91精品久久久久久久91蜜桃| 91视视频在线直接观看在线看网页在线看| 免费在线视频一区| 久久久一区二区三区捆绑**| av一区二区三区黑人| 伊人夜夜躁av伊人久久| 欧美美女一区二区在线观看| 美女爽到高潮91| 国产精品你懂的| 欧美亚洲丝袜传媒另类| 麻豆视频一区二区| 久久久电影一区二区三区| 99久久综合狠狠综合久久| 亚洲午夜激情av| 久久亚洲精华国产精华液| 99久久99久久精品免费观看| 香蕉影视欧美成人| 久久精品亚洲精品国产欧美|