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

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

?? paes.c

?? 多目標優化算法PAES的c語言源代碼,q希望對你有用.
?? C
?? 第 1 頁 / 共 2 頁
字號:
      printf("T1 requires 900 binary genes. You have %d genes and they are %d-ary.\nIt is a 2 objective problem. You have %d objectives. Exiting.\n", genes, alleles, objectives);      exit(-1);    }    //set paramaters to zero  for (i = 0; i < 30; i++)    var[i] = 0;  //convert from binary into integer for the 30 params  for (i = 0; i < 30; i++)    {      mul = 1;      for (j = 29; j >= 0; j--) 	{	  var[i] += mul * s->chrom[i*30+j];	  mul *= 2;	}     }  // normalize the params between 0 and 1  for (i = 0; i < 30; i++)    var[i] /= pow(2,30);  f1 = var[0];  for (i = 1; i < 30; i++)	sum += var[i];    g = 1 + (9*sum)/29.0;    h = 1 - sqrt(f1/g);  f2 = g*h;    s->obj[0]=f1;  s->obj[1]=f2;}void F5(sol *s) // two-objective minimization problem{  int i;  if ((objectives!=2)||(genes!=alleles))    {      printf("You've given invalid command parameters for function F5. Check paes.cc for details. Exiting.\n");      exit(-1);    }  s->obj[0] = genes-1;  // worst score for each objective is genes-1  s->obj[1] = genes-1;    for (i = 0; i < genes-1; i++)    {      if(s->chrom[i+1]== s->chrom[i]+1)   // reduce score of objective 1 if there are adjacent genes having consecutive values	s->obj[0]--;            if(s->chrom[i+1]==s->chrom[i]-1)   // as above but reading in reverse for objective 2	s->obj[1]--;    }}int compare_min(double *first, double *second, int n){  // compares two n-dimensional vectors of objective values for minimization problems  // returns 1 if first dominates second,     返回1:1支配2 -1:2支配1 0:其他  // -1 if second dominates first, and 0 otherwise  int obj = 0;     //比較依據 :若first的每一分量都〉=second的每一分量,且至少有一個〉則first優于second  int deflt = 0;  int current;    do     
  {      if(*first < *second)		  current = 1;      else if(*second < *first)		  current = -1;      else		  current = 0;      
	  if((current)&&(current==-deflt))	  {		  return(0);	  }      if(current!=0)	  {		  deflt = current;	  }      obj++;      *first++;      *second++;	}while(obj < n);    return(deflt);}int compare_max(double *first, double *second, int n){  // as for compare_min() but for maximization problems   int obj = 0;  int deflt = 0;  int current;    do   {      if(*first > *second)		  current = 1;	  else if(*second > *first)		  current = -1;      else		  current = 0;
      if((current)&&(current==-deflt))	  {		  return(0);	  }	  if(current!=0)	  {		  deflt = current;	  }      obj++;      *first++;      *second++;  }while(obj < n);  
  return(deflt);}int equal(double *first, double *second, int n){  // checks to n-dimensional vectors of objectives to see if they are identical  // returns 1 if they are, 0 otherwise  int obj = 0;    do  {	  if(*first!=*second)		  return(0);      *first++;      *second++;      obj++;      // printf("%d\n",obj);  }  while(obj < n);  
  return(1);}void archive_soln(sol *s)  //將s加入archive{  // given a solution s, add it to the archive if  // a) the archive is empty   // b) the archive is not full and s is not dominated or equal to anything currently in the archive  // c) s dominates anything in the archive                          // d) the archive is full but s is nondominated and is in a no more crowded square than at least one solution  // in addition, maintain the archive such that all solutions are nondominated.    int i;  int repl;  int yes = 0;  int most;  int result;  int join = 0;  int old_arclength;  double *evs;  double *evli;   int set = 0;  int tag[MAX_ARC];  sol *tmp;  if (!(tmp = (sol *)malloc(MAX_ARC*sizeof(sol))))    
  {	  printf("Out of memory\n");      exit(-1);  }  for (i = 0; i < archive; i++)    
  {	  tag[i]=0;  }    if (arclength == 0)  {      add_to_archive(s);      return;  }    i = 0;  result = 0;  while((i < arclength)&&(result!=-1))  {      result = equal(s->obj, (&arc[i])->obj, objectives);      if (result == 1)		  break;      //MINIMIZE MAXIMIZE      if (minmax==0)		  result = compare_min(s->obj, (&arc[i])->obj, objectives);      else		  result = compare_max(s->obj, (&arc[i])->obj, objectives);      //  printf("%d\n", result);          if ((result == 1)&&(join == 0))	  {		  arc[i] = *s;             //將第一個受支配的個體替換掉		  join = 1;	  }	  else if (result == 1)        //后面若還有受支配的。。	  {		  tag[i]=1;		  set = 1;	  }	    	          i++;  }  old_arclength = arclength;  if (set==1)  {	  for (i = 0; i < arclength; i++)	  {		  tmp[i] = arc[i];	  }	  
	  arclength = 0;      for (i = 0; i < old_arclength; i++)	  {		  if (tag[i]!=1)           //把其他受支配的刪除		  {			  arc[arclength]=tmp[i];			  arclength++;		  }	  }  }    if ((join==0)&&(result==0))  // ie solution is non-dominated by the list  {                            //也就是說archive中沒有受s支配的個體	  if (arclength == archive)  //archive已滿	  {	  		  most = grid_pop[s->grid_loc];            //.......根據個體密度來替換		  for (i = 0; i < arclength; i++)		  {			  if (grid_pop[(&arc[i])->grid_loc] > most)			  {				  most = grid_pop[(&arc[i])->grid_loc];				  repl = i;				  yes = 1;				  //   printf("i = %d\n", i);			  }		  }	  
		  if (yes)		  {			  arc[repl] = *s;	     		  }	  }      else	  {		  add_to_archive(s);	  }  }  free(tmp);}int find_loc(double *eval)     //這里eval指向一個個體的目標函數值向量{  // find the grid location of a solution given a vector of its objective values  int loc = 0;  int d;  int n = 1;    int i;    int inc[MAX_OBJ];  double width[MAX_OBJ];    //printf("obj = %d, depth = %d\n", objectives, depth);    //if the solution is out of range on any objective, return 1 more than the maximum possible grid location number  for (i = 0; i < objectives; i++)  {	  if ((eval[i] < gl_offset[i])||(eval[i] > gl_offset[i] + gl_range[i]))		  return((int)pow(2,(objectives*depth)));  }  for (i = 0; i < objectives; i++)  {	  inc[i] = n;      n *=2;      width[i] = gl_range[i];  }	      for (d = 1; d <= depth; d++)  {      for (i = 0; i < objectives; i++)	  {		  if(eval[i] < width[i]/2+gl_offset[i])			  loc += inc[i];		  else			  gl_offset[i] += width[i]/2;	  }      
	  for (i = 0; i < objectives; i++)	  {		  inc[i] *= (objectives *2);		  width[i] /= 2;	  }  }  return(loc);} void update_grid(sol *s){  // recalculate ranges for grid in the light of a new solution s  static int change = 0;  int a, b;  int square;  double offset[MAX_OBJ];  double largest[MAX_OBJ];  double sse;  double product;  struct solution **start;    for (a = 0; a < objectives; a++)    {      offset[a] = LARGE;      largest[a] = -LARGE;    }    for (b = 0; b < objectives; b++)    {      for (a = 0; a < arclength; a++)		{	  if ((&arc[a])->obj[b] < offset[b])	    offset[b] = (&arc[a])->obj[b];	  if ((&arc[a])->obj[b] > largest[b])	    largest[b] = (&arc[a])->obj[b];		   	}    }  //printf("oldCURENT:largest = %f, offset = %f\n", largest[0], offset[0]);   //printf("oldCURENT:largest = %f, offset = %f\n", largest[1], offset[1]);   for (b = 0; b < objectives; b++)    {      if (s->obj[b] < offset[b])	offset[b] = s->obj[b];      if (s->obj[b] > largest[b])	largest[b] = s->obj[b];		       }  sse = 0;  product = 1;      for (a = 0; a < objectives; a++)    {       sse += ((gl_offset[a] - offset[a])*(gl_offset[a] - offset[a]));      sse += ((gl_largest[a] - largest[a])*(gl_largest[a] - largest[a]));      product *= gl_range[a];     }  // printf("sse = %f\n", sse);  if (sse > (0.1 * product * product))	//if the summed squared error (difference) between old and new                                        //minima and maxima in each of the objectives    {                                   //is bigger than 10 percent of the square of the size of the space      change++;                         // then renormalise the space and recalculte grid locations      for (a = 0; a < objectives; a++)	{	  gl_largest[a] = largest[a]+0.2*largest[a];	  gl_offset[a] = offset[a]+0.2*offset[a];	  gl_range[a] = gl_largest[a] - gl_offset[a];	}        for (a = 0; a < pow(2, (objectives*depth)); a++)	{	  grid_pop[a] = 0;	}        for (a = 0; a < arclength; a++)	{	  square = find_loc((&arc[a])->obj);	  (&arc[a])->grid_loc = square;	  grid_pop[square]++;	  	}    }  square = find_loc(s->obj);  s->grid_loc = square;  grid_pop[(int)pow(2,(objectives*depth))] = -5;  grid_pop[square]++;     }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲视频在线观看一区| 一本色道a无线码一区v| 一区二区三区日韩精品| 欧美经典三级视频一区二区三区| 日韩欧美在线影院| 欧美一级片在线| 日韩欧美国产小视频| 欧美mv和日韩mv国产网站| 欧美不卡一区二区三区四区| 日韩一二三区不卡| 久久影院视频免费| 国产精品久久一级| 亚洲精品视频免费看| 亚洲成人综合视频| 美女脱光内衣内裤视频久久网站| 精品一区二区在线播放| 国产麻豆精品theporn| 国产黄人亚洲片| 93久久精品日日躁夜夜躁欧美| 91一区二区在线观看| 精品视频一区二区三区免费| 欧美日本一区二区在线观看| 日韩精品影音先锋| 国产精品免费免费| 亚洲大尺度视频在线观看| 免费在线观看不卡| www..com久久爱| 欧美日韩免费在线视频| 久久免费精品国产久精品久久久久| 中文字幕精品一区二区三区精品| 亚洲精选视频免费看| 免费高清在线一区| 91丝袜美腿高跟国产极品老师 | 日韩不卡在线观看日韩不卡视频| 蜜臀国产一区二区三区在线播放| 国产成人精品一区二| 欧美亚洲综合色| 久久久三级国产网站| 亚洲一区二区三区爽爽爽爽爽| 伦理电影国产精品| 91丨九色丨尤物| 久久久久久久久97黄色工厂| 亚洲自拍偷拍图区| 懂色av一区二区三区蜜臀| 欧美丰满一区二区免费视频 | 国产欧美一区二区三区网站| 亚洲欧美电影院| 国产一区二区看久久| 欧美性大战久久| 欧美韩国一区二区| 免费高清成人在线| 欧美日韩成人综合天天影院| 亚洲精品一区二区三区四区高清| 最新久久zyz资源站| 日韩av电影免费观看高清完整版在线观看| 国产在线精品视频| 色狠狠av一区二区三区| 久久综合999| 五月婷婷综合激情| 波多野结衣欧美| 久久久噜噜噜久久中文字幕色伊伊 | 欧美亚洲高清一区二区三区不卡| www亚洲一区| 免费视频最近日韩| 欧美精品乱码久久久久久按摩| 国产精品电影一区二区| 国产中文字幕精品| 欧美哺乳videos| 免费一级欧美片在线观看| 成人一区二区三区视频 | 一本久道中文字幕精品亚洲嫩| 欧美成人免费网站| 人妖欧美一区二区| 欧美色视频一区| 亚洲一区二区三区四区五区中文| 99视频精品全部免费在线| 国产三级欧美三级日产三级99 | 亚洲国产激情av| 国产精品影视天天线| 精品av综合导航| 国内成人免费视频| 国产亚洲精品aa| 岛国av在线一区| 中文字幕在线一区| 色综合久久88色综合天天免费| 欧美激情一区二区三区不卡| 福利一区二区在线| 亚洲欧洲av一区二区三区久久| 成人精品亚洲人成在线| 中文字幕在线观看不卡视频| 一本一道久久a久久精品综合蜜臀| 亚洲欧美日韩国产综合在线| 日本大香伊一区二区三区| 亚洲一区精品在线| 日韩一区二区三区电影| 国产乱码精品一品二品| 国产精品伦一区| 在线精品视频一区二区| 日韩 欧美一区二区三区| 精品99一区二区| 91色|porny| 另类调教123区| 国产精品美女久久久久久久久久久 | 亚洲乱码国产乱码精品精98午夜 | 韩国精品久久久| 亚洲国产精品t66y| 欧美日韩亚洲综合在线| 黑人精品欧美一区二区蜜桃| 国产精品福利影院| 91精品国产免费久久综合| 国产福利91精品一区二区三区| 亚洲裸体xxx| 欧美成人一级视频| 91麻豆免费观看| 美日韩一区二区| 中文字幕中文字幕一区二区 | 国产精选一区二区三区| 亚洲色图视频免费播放| 欧美一区二区三区日韩视频| 成人动漫视频在线| 日韩中文字幕一区二区三区| 欧美国产一区二区在线观看 | 大白屁股一区二区视频| 亚洲大片免费看| 中文字幕一区二区三区在线不卡| 555www色欧美视频| 91无套直看片红桃| 久久66热re国产| 亚洲一卡二卡三卡四卡无卡久久| 精品国产免费一区二区三区四区| 91麻豆精品一区二区三区| 久久精品国产网站| 五月婷婷综合在线| 伊人色综合久久天天人手人婷| 久久夜色精品一区| 91精品国产综合久久福利软件| www.欧美.com| 成人中文字幕合集| 久久9热精品视频| 天天免费综合色| 亚洲一区二区三区小说| 亚洲精品高清在线观看| 中文字幕国产一区| 国产香蕉久久精品综合网| 日韩欧美在线1卡| 制服丝袜亚洲播放| 在线电影院国产精品| 在线观看欧美日本| 91视频观看视频| 日本久久精品电影| 日本伦理一区二区| 日本久久电影网| 色av综合在线| 91黄色激情网站| 在线日韩国产精品| 在线观看区一区二| 欧美人与z0zoxxxx视频| 欧美日本国产一区| 欧美一级高清片在线观看| 日韩一区二区视频| 日韩一区二区三| 精品免费国产二区三区| 日韩精品一区国产麻豆| 日韩你懂的电影在线观看| 精品日韩一区二区三区| 精品国产百合女同互慰| 欧美精品一区二区久久婷婷| 久久久久久久久久久99999| 国产日韩欧美在线一区| 自拍偷拍欧美激情| 亚洲国产人成综合网站| 日韩高清不卡在线| 美女视频一区在线观看| 国产一区二区三区综合| 成人午夜短视频| 欧美性猛交xxxx乱大交退制版| 欧美色图在线观看| 日韩三级视频在线观看| 欧美激情自拍偷拍| 亚洲自拍偷拍综合| 韩国v欧美v日本v亚洲v| 99久久精品国产网站| 欧美日韩精品是欧美日韩精品| 777午夜精品免费视频| 久久精品亚洲一区二区三区浴池 | 老鸭窝一区二区久久精品| 丁香另类激情小说| 欧美日韩精品一二三区| 久久久国产综合精品女国产盗摄| 国产精品短视频| 麻豆精品一区二区三区| 99re这里只有精品首页| 91精品免费在线| 中文字幕日韩一区| 亚洲免费观看高清完整版在线 | 欧美精品乱码久久久久久| 中文字幕精品一区| 精品中文字幕一区二区小辣椒| 91免费看片在线观看| 久久久精品蜜桃|