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

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

?? individual.cpp

?? 遺傳算法(Genetic Algorithm)是一類借鑒生物界的進化規律(適者生存
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/***************************************************************/* Single & Multi-Objective Real-Coded Genetic Algorithms Code *//* Author: Kumara Sastry                                       *//* Illinois Genetic Algorithms Laboratory (IlliGAL)            *//* Deparment of General Engineering                            *//* University of Illinois at Urbana-Champaign                  *//* 104 S. Mathews Ave, Urbana, IL 61801                        *//***************************************************************/#include "individual.hpp"// Started Modification 02/14/2001:21:19:59 - PVPextern GlobalSetup *globalSetup;extern void globalEvaluate(double *values, double *objFunction, 			   double *violation, double *penalty, 			   int *noOfViolations);Individual::Individual(void) {  // This is the default constructor. Here, the properties  // of the Individual will be set appropriately. It should be  // noted that the default constructor of a parent class is  // automatically called when a child class object is constructed.  // The reason why I am saying this is that we have double *fitness  // etc and we would have to initialize it in the NsgaIndividual  // class constructor to an array of fitness, etc. Here, we should  // take care that we do not allocate it again. Therefore, we have  // to check what type of GA this is, before we allocate memory.  // The things to be initialized:  //    1.   Chromosome chrom; - just call default constructor - will be initialized to a random chromosome based on bounds  //    2.   double *fitness; - initialize to new doubl if GA is SGA  //    3.   double *objFunction; -          -do-  //    4.   double penalty;  - initialize to ZERO.  //    5.   double *violation, totalViolation; - Set violation to NULL if unconstrained.  //    6.   int *freezeMask; - initialize to int[globalSetup->noOfVariables] and set everything to 0.  // Do the evaluation after everything is done.  // Chromosomes default constructor is called automatically.  if (!(globalSetup->finalNoOfConstraints))    violation = NULL;  else    violation = new double[globalSetup->finalNoOfConstraints];  noOfViolations = 0;  penalty = 0.0;  if (globalSetup->gaType==SGA) {    fitness = new double(0.00);    objFunction = new double(0.00);    if(!(globalSetup->loadPopulation)) evaluateFitness(); // If Nsga, it's constructor will call it's evaluate.  }}Individual::Individual(const Individual &sourceInd ) {  // Call operator= of chromosomes and just copy all other values after appropriate allocations  int ii;  chrom = sourceInd.chrom;  if (globalSetup->gaType==SGA) {    fitness = new double(*(sourceInd.fitness));    objFunction = new double(*(sourceInd.objFunction));  }  if (globalSetup->finalNoOfConstraints) {    noOfViolations = sourceInd.noOfViolations;    violation = new double[globalSetup->finalNoOfConstraints];    for(ii = 0; ii < globalSetup->finalNoOfConstraints; ii++)       violation[ii] = sourceInd.violation[ii];    penalty = sourceInd.penalty;  }  else    violation = NULL;}Individual::Individual(const Individual *sourceInd ){  int ii;  chrom = sourceInd->chrom;  if (globalSetup->gaType==SGA) {    fitness = new double(*(sourceInd->fitness));    objFunction = new double(*(sourceInd->objFunction));  }  if (globalSetup->finalNoOfConstraints) {    noOfViolations = sourceInd->noOfViolations;    violation = new double[globalSetup->finalNoOfConstraints];    for(ii = 0; ii < globalSetup->finalNoOfConstraints; ii++)       violation[ii] = sourceInd->violation[ii];    penalty = sourceInd->penalty;  }  else    violation = NULL;}Individual & Individual::operator= (const Individual &sourceInd) {  // Difference between copy constructor and this is   // that this guy has already been allocated some memory  // for the dynamically allocated stuff and so it has to be freed  // and copied or copied without reallocation.  int ii;  chrom = sourceInd.chrom;  if (globalSetup->gaType==SGA) {    *fitness = (*(sourceInd.fitness));    *objFunction = (*(sourceInd.objFunction));  }  if(globalSetup->finalNoOfConstraints) {    noOfViolations = sourceInd.noOfViolations;    for(ii = 0; ii < globalSetup->finalNoOfConstraints; ii++)       violation[ii] = sourceInd.violation[ii];    penalty = sourceInd.penalty;  }  return *this;}void Individual::loadIndividual(double *varValues, double *objValues, double *constViolValues, double penaltyValue) {  int ii;  for(ii = 0; ii < globalSetup->noOfDecisionVariables; ii++)     chrom[ii] = varValues[ii];  for(ii = 0; ii < globalSetup->finalNoOfObjectives; ii++)     objFunction[ii] = objValues[ii];  if(globalSetup->finalNoOfConstraints) {    noOfViolations = 0;    for(ii = 0; ii < globalSetup->finalNoOfConstraints; ii++)       violation[ii] = constViolValues[ii];    if(violation[ii] >= 1.0e-5) {      noOfViolations++;    }    penalty = penaltyValue;  }}void Individual::evaluateFitness(void) {  double *values;  int ii;    values = new double[globalSetup->noOfDecisionVariables];		  for (ii = 0; ii < globalSetup->noOfDecisionVariables; ii++)    values[ii] = chrom[ii];  globalEvaluate(values, objFunction, violation,		 &penalty, &noOfViolations);  delete [] values;}void Individual::mutate(int *freezeMask) {  switch(globalSetup->mutationType) {  case Selective:    chrom.mutateMinMax(freezeMask);    break;  case Genewise:    chrom.mutateNormal(freezeMask);    break;  case Polynomial:    chrom.mutatePolynomial(freezeMask);    break;  default: exit(0);  }}Individual::~Individual(void) {  if (globalSetup->gaType==SGA) {    delete fitness;    delete objFunction;  }  if (globalSetup->finalNoOfConstraints)     delete [] violation;}// Some stuff for NsgaIndividualNsgaIndividual::NsgaIndividual(void) {  // At this point, chrom is ready, violation is ready and freezeMask is there even though it is   // not necessary. We have to initialize fitness and objFunction and do the evaluation  fitness = new double[globalSetup->finalNoOfObjectives];  objFunction = new double[globalSetup->finalNoOfObjectives];  rank = 0;  crowdingDistance=0.0;  if(!(globalSetup->loadPopulation)) evaluateFitness();}NsgaIndividual::NsgaIndividual(const Individual &sourceInd):Individual(sourceInd) {  int ii;  NsgaIndividual *newSource = (NsgaIndividual *) &sourceInd;  fitness = new double[globalSetup->finalNoOfObjectives];  objFunction = new double[globalSetup->finalNoOfObjectives];    for(ii = 0; ii < globalSetup->finalNoOfObjectives; ii++) {    fitness[ii] = newSource->fitness[ii];    objFunction[ii] = newSource->objFunction[ii];  }  rank = newSource->rank;  crowdingDistance = newSource->crowdingDistance;}NsgaIndividual::NsgaIndividual(const Individual *sourceInd):Individual(*sourceInd){  int ii;    NsgaIndividual *newSource = (NsgaIndividual *) sourceInd;  fitness = new double[globalSetup->finalNoOfObjectives];  objFunction = new double[globalSetup->finalNoOfObjectives];  for (ii = 0; ii < globalSetup->finalNoOfObjectives; ii++) {    fitness[ii] = newSource->fitness[ii];    objFunction[ii] = newSource->objFunction[ii];  }  rank = newSource->rank;  crowdingDistance = newSource->crowdingDistance;}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;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内外精品视频| 亚洲国产另类精品专区| 精品久久国产字幕高潮| 在线播放亚洲一区| 欧美日韩一区二区三区高清 | 欧美一区二区精品在线| 91国偷自产一区二区三区成为亚洲经典| 成人午夜激情视频| 成人app在线| 日本久久一区二区| 欧美美女一区二区三区| 日韩一区二区三区免费观看| 欧美一区二区播放| 久久久影视传媒| 国产精品免费人成网站| 亚洲色图在线视频| 香蕉影视欧美成人| 老司机免费视频一区二区| 激情综合色综合久久综合| 成人高清视频在线观看| 色偷偷一区二区三区| 欧美狂野另类xxxxoooo| 久久久久国产免费免费| 1000部国产精品成人观看| 亚洲一二三区在线观看| 久久99精品久久久久久动态图| 国产精品一二三| 色视频欧美一区二区三区| 69p69国产精品| 欧美激情中文字幕一区二区| 亚洲欧美一区二区三区国产精品| 亚洲成人第一页| 国产乱淫av一区二区三区| 色婷婷久久久综合中文字幕| 欧美一区二区三区免费大片| 国产午夜亚洲精品不卡| 亚洲福利一二三区| 激情国产一区二区| 欧美三级一区二区| 国产欧美一区视频| 日韩电影免费在线看| 成人av综合在线| 日韩午夜电影在线观看| 专区另类欧美日韩| 国产麻豆日韩欧美久久| 欧美日韩激情在线| 中文字幕亚洲综合久久菠萝蜜| 日本不卡中文字幕| 色婷婷国产精品久久包臀| 国产日韩欧美不卡| 久久精品国产久精国产| 欧美视频一区二| 国产精品久久久久一区| 国产在线精品免费av| 8v天堂国产在线一区二区| 亚洲欧美日韩人成在线播放| 国产一区二区三区在线观看免费视频| 欧美性三三影院| 亚洲免费伊人电影| 成人avav影音| 国产精品女上位| 国产做a爰片久久毛片| 日韩一区二区免费高清| 午夜精品在线看| 欧美日韩一卡二卡三卡| 亚洲男同性恋视频| 99国产精品一区| 国产精品麻豆欧美日韩ww| 国产寡妇亲子伦一区二区| 精品成a人在线观看| 日产精品久久久久久久性色| 欧美日韩卡一卡二| 亚洲bt欧美bt精品| 欧美日本一道本| 午夜精彩视频在线观看不卡| 欧美午夜一区二区三区免费大片| 最新中文字幕一区二区三区 | 国产精品超碰97尤物18| 成人午夜电影小说| 中文字幕第一区综合| 成人性生交大片免费看中文网站| 久久久精品一品道一区| 成人性生交大片免费看中文 | 欧美在线一区二区三区| 一区二区三区高清| 欧美日韩国产片| 人妖欧美一区二区| 欧美精品一区二区精品网| 久久久久久影视| 亚洲国产精品自拍| 欧美丰满高潮xxxx喷水动漫| 视频一区国产视频| 欧美mv日韩mv国产网站| 国产盗摄一区二区| 伊人性伊人情综合网| 欧美日韩国产精选| 经典三级一区二区| 国产精品高潮呻吟| 欧美日韩国产在线播放网站| 日韩高清不卡一区二区| 久久久青草青青国产亚洲免观| 成人黄色综合网站| 亚洲国产aⅴ天堂久久| 欧美刺激午夜性久久久久久久| 国产99精品视频| 亚洲国产精品久久久久婷婷884| 制服丝袜亚洲色图| 成人午夜免费av| 日韩电影免费在线看| 一区二区在线观看av| 不卡的av在线| 91精品一区二区三区在线观看| 国产精品看片你懂得| 亚洲自拍偷拍九九九| 另类小说欧美激情| 欧美美女喷水视频| 欧美日韩大陆一区二区| 欧美一区二区三区免费观看视频| 日韩成人dvd| 91精彩视频在线| 日本欧美一区二区| 成人欧美一区二区三区白人| 日韩一级二级三级精品视频| av一区二区三区在线| 蜜臀a∨国产成人精品| 中文字幕在线不卡视频| 日韩欧美久久一区| 欧美性一二三区| 成人丝袜高跟foot| 久久超碰97中文字幕| 一区二区三区日韩欧美| 国产欧美一区二区精品性色 | 久久国产尿小便嘘嘘尿| 亚洲视频一区二区免费在线观看| 精品国产伦一区二区三区观看体验 | 成人免费视频一区| 国产伦精品一区二区三区视频青涩| 亚洲一区二区影院| 国产精品伦一区| 国产女主播一区| 久久久久久亚洲综合| 日韩一区国产二区欧美三区| 欧美性色综合网| 91成人免费电影| 91丨九色丨蝌蚪富婆spa| 国产精品538一区二区在线| 久久精品国产在热久久| 免费高清不卡av| 免费成人av在线| 久久99精品国产.久久久久久| 丝袜美腿成人在线| 免费在线观看日韩欧美| 日韩影视精彩在线| 日韩高清不卡一区| 久久精品国产在热久久| 国产真实精品久久二三区| 老鸭窝一区二区久久精品| 麻豆精品在线观看| 蜜乳av一区二区三区| 美女高潮久久久| 精品一区在线看| 国产盗摄精品一区二区三区在线| 国产在线看一区| 高清久久久久久| 成人在线视频首页| 色88888久久久久久影院野外| 欧美日韩在线一区二区| 欧美精品精品一区| 欧美xxxxxxxx| 中文字幕五月欧美| 亚洲国产日韩一区二区| 久久精品久久99精品久久| 国产做a爰片久久毛片| 97精品超碰一区二区三区| 欧美视频自拍偷拍| 日韩欧美高清在线| 欧美国产乱子伦| 一区二区三区欧美视频| 日本在线观看不卡视频| 国产一区中文字幕| 日本精品一区二区三区四区的功能| 欧美午夜一区二区三区| 精品少妇一区二区| 最新日韩av在线| 日本色综合中文字幕| 国产夫妻精品视频| 欧美午夜片在线看| 久久久精品tv| 亚洲电影中文字幕在线观看| 韩国三级中文字幕hd久久精品| av电影一区二区| 欧美tk丨vk视频| 亚洲精品日日夜夜| 国内精品嫩模私拍在线| 91久久精品日日躁夜夜躁欧美| 国产精品超碰97尤物18| 麻豆国产欧美一区二区三区| 99re热视频这里只精品| 精品国产一区久久| 亚洲电影欧美电影有声小说|