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

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

?? individual.cpp

?? 遺傳算法(Genetic Algorithm)是一類借鑒生物界的進(jìn)化規(guī)律(適者生存
?? CPP
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
}NsgaIndividual::NsgaIndividual(const NsgaIndividual *sourceInd):Individual(*sourceInd){  int ii;  fitness = new double[globalSetup->finalNoOfObjectives];  objFunction = new double[globalSetup->finalNoOfObjectives];  for (ii = 0; ii < globalSetup->finalNoOfObjectives; ii++) {    fitness[ii] = sourceInd->fitness[ii];    objFunction[ii] = sourceInd->objFunction[ii];  }  rank = sourceInd->rank;  crowdingDistance = sourceInd->crowdingDistance;}NsgaIndividual::~NsgaIndividual(void) {  // Here Individual's destructor is called automatically.  // No need to call Individual::~Individual explicitly.  delete [] fitness;  delete [] objFunction;}NsgaIndividual & NsgaIndividual::operator= (const NsgaIndividual &sourceInd) {  int ii;  *((Individual *)this) = sourceInd;  for (ii=0; ii<globalSetup->finalNoOfObjectives; ii++) {    fitness[ii] = sourceInd.fitness[ii];    objFunction[ii] = sourceInd.objFunction[ii];  }  rank = sourceInd.rank;  crowdingDistance = sourceInd.crowdingDistance;  return *this;}NsgaIndividual & NsgaIndividual::operator= (const Individual &sourceInd){  int ii;  Individual::operator=(sourceInd);  NsgaIndividual *newSource = (NsgaIndividual *)&sourceInd;  for(ii = 0; ii < globalSetup->finalNoOfObjectives; ii++) {    fitness[ii] = newSource->fitness[ii];    objFunction[ii] = newSource->objFunction[ii];  }  rank = newSource->rank;  crowdingDistance = newSource->crowdingDistance;  return *this;}std::ostream &operator << (std::ostream &out, Individual &x) {  out << x.chrom;  out << "Objective Function value = " << *(x.objFunction) << std::endl;  for (int i=0; i<globalSetup->finalNoOfConstraints; i++)    out << "Constraint Violation #" << i << " " << x.violation[i] << std::endl;  return out;}/***Crowding comparison operator: Determines if NsgaIndvidual 1 is better than NsgaIndividual 2.If the rank of individual 1 is less than that of individual 2, then return 1. If the rank of individual 1 and 2 are same and the crowding distance of individual 1 is greater than that of individual 2 then return 1. For all other cases return 0.*/bool crowdingComp (const NsgaIndividual *guy1, const NsgaIndividual *guy2) {  if((guy1->rank < guy2->rank)||     ((guy1->rank == guy2->rank)&&      (guy1->crowdingDistance > guy2->crowdingDistance))) return 1;  else return 0;}/***Constraint tournament comparison operator: Determines if the individual 1 is better than individual 2.The flag compareWhat selects whether the objective value or the fitness is to be compared. If objective value is to be compared and we are required to maximise the objective function then the fitness is set to be equal to the objective value. On the other hand if the objective function is to be minimized, then the fitness is set to negative of objective function.If both the individuals are feasible or if they have the same amount of infeasibility (quantified by total constraint violation), then return 1 if the fitnessof individual 1 is greater than that of individual 2. On the other hand if individual 1 is feasible and individual 2 is infeasible then return 1.If both individuals are infeasible but individual 1 has lower infeasibility (lower constraint violation value) then return 1.For all other cases return 0 */bool constrTournComp (const Individual *guy1, const Individual *guy2, int compareWhat) {  double guy1Fitness, guy2Fitness;  switch(compareWhat) {  case FITNESS:    guy1Fitness = *(guy1->fitness);    guy2Fitness = *(guy2->fitness);    break;  case OBJECTIVE:    if(*(globalSetup->typeOfOptimizations) == Maximization) {      guy1Fitness = *(guy1->objFunction);      guy2Fitness = *(guy2->objFunction);    }    else {      guy1Fitness = -(*(guy1->objFunction));      guy2Fitness = -(*(guy2->objFunction));    }    break;  default: exit(0);  }  if((guy1->penalty <= ZERO) && (guy2->penalty > ZERO))    return 1;  else if(((guy1->penalty <= ZERO)&&(guy2->penalty <= ZERO))||	  (fabs(guy1->penalty-guy2->penalty) <= ZERO)) {    if(guy1Fitness > guy2Fitness) return 1;  }  else     if(guy1->penalty < guy2->penalty) return 1;  return 0;}/**Domination determinator. Determines if NsgaIndvidual 1 dominates NsgaIndvidual 2.If the constraint handling method is either penalty method or if there are no constraints, then   -- If every fitness value of individual 1 is greater than or equal to the fitness value of individual 2 then return 1.   -- If every fitness value of individual 2 is greater than or equal to the fitness value of individual 2 then return -1.  -- For all other cases return 0.If the constraint handling method is through tournament selection, then  -- If both individuals are feasible or have the same amount of infeasibility, then if every fitness value of individual 1 is greater than or equal to the fitness value of individual 2 then return 1.   -- If indiviudal 1 is feasible and individual 2 is infeasible return 1.  -- If both individuals are infeasible, but the infeasiblity of individual 1 is lesser than individual 2 then return 1  -- If both individuals are feasible or have the same amount of infeasibility, then if every fitness value of individual 2 is greater than or equal to the fitness value of individual 1 then return -1.   -- If indiviudal 2 is feasible and individual 1 is infeasible then return -1  -- If both individuals are infeasible, but the infeasiblity of individual 2 is lesser than individual 1 then return -1.  -- For all other cases return 0.*/int dominates (const NsgaIndividual *guy1, const NsgaIndividual *guy2){  int ii, idomj = 0, jdomi = 0;    switch(globalSetup->constraintMethod) {  case NoConstraints:    for(ii = 0; ii < globalSetup->finalNoOfObjectives; ii++) {      if(guy1->fitness[ii] > guy2->fitness[ii]) idomj = 1;      else if(guy1->fitness[ii] < guy2->fitness[ii]) jdomi = 1;    }    break;  case Penalty:    for(ii = 0; ii < globalSetup->finalNoOfObjectives; ii++) {      if(guy1->fitness[ii] > guy2->fitness[ii]) idomj = 1;      else if(guy1->fitness[ii] < guy2->fitness[ii]) jdomi = 1;    }    break;  case Tournament:    if((guy1->penalty <= ZERO)&&(guy2->penalty <= ZERO)) {      for(ii = 0; ii < globalSetup->finalNoOfObjectives; ii++) {	if(guy1->fitness[ii] > guy2->fitness[ii]) idomj = 1;	else if(guy1->fitness[ii] < guy2->fitness[ii]) jdomi = 1;      }    }    else if(((guy1->penalty <= ZERO)&&(guy2->penalty <= ZERO))||	    (fabs(guy1->penalty-guy2->penalty) <= ZERO)) {      for(ii = 0; ii < globalSetup->finalNoOfObjectives; ii++) {	if(guy1->fitness[ii] > guy2->fitness[ii]) idomj = 1;	else if(guy1->fitness[ii] < guy2->fitness[ii]) jdomi = 1;      }    }    else {      if(guy1->penalty < guy2->penalty) idomj = 1;      else if(guy2->penalty < guy1->penalty) jdomi = 1;    }    break;  default: exit(0);  }  if((idomj == 1)&&(jdomi == 1)) return INONDOMJ;  else if((idomj == 1)&&(jdomi == 0)) return IDOMJ;  else if((idomj == 0)&&(jdomi == 1)) return JDOMI;  else return INONDOMJ;}/// Penaly constraint comparison operator: Checks if indiviudal 1 is better than individual 2 if the constraint handling is through penalty method.bool constrPenaltyComp(const Individual *guy1, const Individual *guy2) {  if(*(globalSetup->typeOfOptimizations) == Maximization) {    if(*(guy1->objFunction) - guy1->penalty >       *(guy2->objFunction) - guy2->penalty) return 1;  }  else {    if(*(guy1->objFunction) + guy1->penalty <        *(guy2->objFunction) + guy2->penalty) return 1;  }  return 0;}///Individual comparison operator: Determines if individual 1 is better than individual 2 when no constraints are present.bool individualComp(const Individual *guy1, const Individual *guy2) {  if(*(globalSetup->typeOfOptimizations) == Maximization) {    if(*(guy1->objFunction) > *(guy2->objFunction)) return 1;  }  else {    if(*(guy1->objFunction) < *(guy2->objFunction)) return 1;  }  return 0;}bool isBetter(const Individual *guy1, const Individual *guy2){  bool status;    switch(globalSetup->constraintMethod) {  case NoConstraints:    status = individualComp(guy1, guy2);    break;  case Penalty:    status = constrPenaltyComp(guy1, guy2);    break;  case Tournament:    status = constrTournComp(guy1, guy2, OBJECTIVE);    break;  default:    exit(0);  }  return status;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美一区二区三区鸳鸯浴| 欧美午夜一区二区三区 | 中文字幕亚洲不卡| 欧美人动与zoxxxx乱| 国产精品一区二区久久精品爱涩| 一区二区三区在线观看视频| 精品蜜桃在线看| 欧美性大战久久| 成人免费毛片高清视频| 免费xxxx性欧美18vr| 亚洲男人的天堂在线aⅴ视频| 欧美成人精品福利| 欧美色综合久久| 成人av在线看| 国产伦精一区二区三区| 天堂影院一区二区| 国产尤物一区二区| 亚洲成va人在线观看| 中文字幕制服丝袜成人av| 欧美不卡激情三级在线观看| 欧美日韩国产电影| 色一情一乱一乱一91av| 成人午夜视频在线| 黄页网站大全一区二区| 日韩成人av影视| 亚洲18影院在线观看| 亚洲日本成人在线观看| 中文字幕av不卡| 久久久久久久精| 欧美不卡一区二区三区四区| 欧美一卡2卡三卡4卡5免费| 欧美日韩亚洲另类| 欧美在线高清视频| 欧美亚洲一区二区在线| 欧美在线影院一区二区| 97精品久久久久中文字幕| 成人深夜视频在线观看| 高清成人免费视频| 成人永久免费视频| 国产成人精品午夜视频免费| 国产一区二区三区精品视频| 国产在线精品免费| 国产综合一区二区| 国产激情一区二区三区四区| 国产成人啪午夜精品网站男同| 激情综合色播激情啊| 精品一区二区三区日韩| 国产综合成人久久大片91| 国产精品一二一区| 国产成人日日夜夜| 91视频国产观看| 在线视频你懂得一区| 欧美日韩精品一区视频| 91精品免费观看| 午夜精品福利一区二区三区av| 亚洲资源中文字幕| 日一区二区三区| 麻豆国产欧美一区二区三区| 卡一卡二国产精品| 国产乱子伦一区二区三区国色天香| 国产很黄免费观看久久| 99久久综合国产精品| 在线视频国产一区| 欧美一区二区三区免费大片 | 欧美一区二区视频在线观看| 欧美成人福利视频| 国产精品污网站| 一区二区三区免费在线观看| 亚洲成人自拍网| 精品一区二区在线观看| 从欧美一区二区三区| 欧洲一区在线观看| 日韩一本二本av| 中文字幕av一区 二区| 亚洲最新视频在线观看| 全国精品久久少妇| 成人一区二区三区在线观看| 日本精品一区二区三区高清| 欧美精品v国产精品v日韩精品 | 国产欧美一二三区| 一区二区三区精密机械公司| 男女男精品视频| 国产成人午夜精品影院观看视频 | 天堂一区二区在线| 福利视频网站一区二区三区| 欧洲一区二区三区免费视频| 精品国产精品一区二区夜夜嗨| 亚洲欧洲日韩在线| 青草av.久久免费一区| 成人高清视频免费观看| 777久久久精品| 亚洲欧洲成人av每日更新| 日本亚洲免费观看| 94-欧美-setu| 精品理论电影在线观看| 亚洲黄色小视频| 国产精品77777| 欧美日韩国产另类一区| 国产精品久久久久久户外露出 | 激情五月播播久久久精品| 色综合久久综合网欧美综合网| 欧美一区二区女人| 一级特黄大欧美久久久| 国产成人啪免费观看软件| 7777精品伊人久久久大香线蕉最新版| 国产精品美女一区二区在线观看| 日韩1区2区3区| 日本丰满少妇一区二区三区| 久久久精品蜜桃| 免费精品99久久国产综合精品| 91极品美女在线| 国产精品女上位| 国产精品99久| 精品福利av导航| 日韩av在线发布| 欧美三级视频在线| 亚洲精品日韩专区silk | 欧美日韩免费在线视频| 中文字幕亚洲欧美在线不卡| 国产美女一区二区三区| 欧美一区二区福利在线| 五月综合激情婷婷六月色窝| 色综合天天综合在线视频| 国产精品女主播在线观看| 国产一区二区三区在线观看精品| 91精品国产色综合久久不卡蜜臀| 亚洲精品视频一区二区| 99久久亚洲一区二区三区青草| 国产日韩v精品一区二区| 激情综合色播五月| 日韩欧美不卡一区| 蜜臀精品久久久久久蜜臀| 在线成人午夜影院| 日韩主播视频在线| 欧美日韩一区久久| 亚洲国产精品人人做人人爽| 在线看日本不卡| 亚洲国产中文字幕在线视频综合| 在线看不卡av| 婷婷综合另类小说色区| 欧美肥胖老妇做爰| 美女视频网站黄色亚洲| 日韩三级免费观看| 精品一区二区三区在线播放视频| 日韩欧美激情在线| 国产一区二区三区美女| 久久你懂得1024| 国产不卡高清在线观看视频| 中文字幕欧美激情| 99精品视频在线观看| 亚洲男女一区二区三区| 欧美自拍丝袜亚洲| 午夜欧美在线一二页| 日韩一区二区在线观看视频| 麻豆91精品91久久久的内涵| 久久这里只有精品视频网| 国产成人99久久亚洲综合精品| 欧美国产1区2区| 欧美中文字幕亚洲一区二区va在线| 亚洲一区二区三区视频在线播放| 欧美日韩激情一区二区三区| 日本不卡一区二区三区| 久久夜色精品一区| 92国产精品观看| 午夜电影一区二区三区| 久久久久久夜精品精品免费| 成人精品gif动图一区| 一区二区三区四区不卡视频| 欧美精品vⅰdeose4hd| 国产福利91精品| 亚洲免费观看高清完整版在线观看| 欧美一a一片一级一片| 另类小说综合欧美亚洲| 国产精品久久久久久久久晋中| 欧美日韩另类国产亚洲欧美一级| 精品一区二区综合| 亚洲欧美综合网| 欧美一级专区免费大片| 成人精品鲁一区一区二区| 天堂资源在线中文精品| 国产亚洲精品bt天堂精选| 在线精品国精品国产尤物884a| 久久福利视频一区二区| 亚洲欧美日韩中文字幕一区二区三区| 4438x亚洲最大成人网| 成人美女视频在线观看| 日韩电影一区二区三区四区| 国产精品国产自产拍高清av| 欧美日韩三级一区| 不卡电影免费在线播放一区| 石原莉奈一区二区三区在线观看| 国产丝袜欧美中文另类| 欧美日韩卡一卡二| 97精品国产露脸对白| 久久国内精品自在自线400部| 亚洲伦理在线精品| 国产亚洲欧洲997久久综合| 欧美美女网站色| 99久久精品一区| 国产精品一区免费在线观看|