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

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

?? boa.cc

?? PostsBayesian Optimization Algorithm with Decision Graphs in C++,
?? CC
字號:
// ################################################################################//// name:          boa.cc      //// author:        Martin Pelikan//// purpose:       functions for the initialization of the BOA, the BOA itself and //                a done method for the BOA//// last modified: February 1999//// #################################################################################include <stdio.h>#include <stdlib.h>#include "boa.h"#include "population.h"#include "statistics.h"#include "replace.h"#include "select.h"#include "graph.h"#include "bayesian.h"#include "K2.h"#include "fitness.h"#include "memalloc.h"#include "random.h"// --------------------// various output files// --------------------FILE *logFile;FILE *fitnessFile;FILE *modelFile;BasicStatistics populationStatistics;// --------------------------------------------------------// the description of termination criteria that are checked// --------------------------------------------------------char *terminationReasonDescription[5] = {"No reason","Maximal number of generations reached","Bit convergence (with threshold epsilon)","Proportion of optima in a population reached the threshold","Optimum has been found"};// ================================================================================//// name:          initialize//// function:      initializes everything the BOA needs to be run properly//                (initialize fitness function, metric, random number generator,//                etc.)//// parameters:    boaParams....the parameters sent to the BOA//// returns:       (int) 0//// ================================================================================int initialize(BoaParams *boaParams){  char filename[200];  // set the fitness function to be optimized  setFitness(boaParams->fitnessNumber);   // initialize fitness  initializeFitness(boaParams);  // initialize metric  initializeMetric(boaParams);  // reset the counter for fitness calls  resetFitnessCalls();  // set random seed  setSeed(boaParams->randSeed);  // initialize statistics  intializeBasicStatistics(&populationStatistics,boaParams);  // open output files (if the base of the output file names specified)  if (boaParams->outputFilename)    {      sprintf(filename,"%s.log",boaParams->outputFilename);      logFile = fopen(filename,"w");      sprintf(filename,"%s.fitness",boaParams->outputFilename);      fitnessFile = fopen(filename,"w");      sprintf(filename,"%s.model",boaParams->outputFilename);      modelFile = fopen(filename,"w");    }  else    logFile = fitnessFile = modelFile = NULL;  // get back  return 0;};// ================================================================================//// name:          boa//// function:      the kernel of the BOA (runs the BOA for a chosen problem)//// parameters:    boaParams....the parameters sent to the BOA//// returns:       (int) 0//// ================================================================================int boa(BoaParams *boaParams){  long       N,numOffspring,numParents,t;  int        n;  Population population,parents,offspring;  int        terminationReason;  // set some variables  N            = boaParams->N;  numOffspring = (long) (boaParams->N*boaParams->percentOffspring)/100;  numParents   = (long) (boaParams->N*boaParams->percentParents)/100;  n            = boaParams->n;  // allocate the memory for the population  allocatePopulation(&population,N,n);  allocatePopulation(&parents,numParents,n);  allocatePopulation(&offspring,numOffspring,n);  // randomly generate first population according to uniform distribution  generatePopulation(&population);  // evaluate first population  evaluatePopulation(&population);  // main loop  t=0;  // compute basic statistics on initial population  computeBasicStatistics(&populationStatistics,t,&population,boaParams);  // output the statistics on first generation  generationStatistics(stdout,&populationStatistics);  generationStatistics(logFile,&populationStatistics);  fitnessStatistics(fitnessFile,&populationStatistics);  // pause after statistics?  pause(boaParams);  while (!(terminationReason=terminationCriteria(boaParams)))    {      // perform truncation (block) selection      selectTheBest(&population,&parents,numParents);      // create offspring      generateOffspring(t,&parents,&offspring,boaParams);            // evaluate the offspring      evaluatePopulation(&offspring);      // replace the worst of the population with offspring      replaceWorst(&population,&offspring);            // increase the generation number         t++;      // compute basic statistics      computeBasicStatistics(&populationStatistics,t,&population,boaParams);      // output the statistics on current generation      generationStatistics(stdout,&populationStatistics);      generationStatistics(logFile,&populationStatistics);      fitnessStatistics(fitnessFile,&populationStatistics);      // pause after statistics?      pause(boaParams);    };  // print out final statistics  computeBasicStatistics(&populationStatistics,t,&population,boaParams);    finalStatistics(stdout,terminationReasonDescription[terminationReason],&populationStatistics);  finalStatistics(logFile,terminationReasonDescription[terminationReason],&populationStatistics);    // free the memory used by the population, the parents, and the offspring  freePopulation(&population);  freePopulation(&parents);  freePopulation(&offspring);  // get back  return 0;};// ================================================================================//// name:          terminationCriteria//// function:      checks whether some of the termination criteria wasn't matched//                and returns the number of the criterion that has been met or 0//// parameters:    boaParams....the parameters sent to the BOA//// returns:       (int) the number of a met criterion or 0 if none has been met//// ================================================================================int terminationCriteria(BoaParams *boaParams){  int result;  // no reason to finish yet  result=0;  // check if the proportion of optima reached the required value, if yes terminate  if ((!result)&&(boaParams->maxOptimal>=0))    result = (float(populationStatistics.numOptimal*100)/populationStatistics.N>=boaParams->maxOptimal)? MAXOPTIMAL_TERMINATION:0;  // check if should terminate if optimum has been found and if this is the case if yes  if ((!result)&&(boaParams->stopWhenFoundOptimum))    if (isBestDefined())      result = (isOptimal(populationStatistics.bestX,populationStatistics.n))? OPTIMUMFOUND_TERMINATION:0;  // if there's no reason to finish yet and the epsilon threshold was set, check it  if ((!result)&&(boaParams->epsilon>=0))    {      int   k;      float epsilon1;      // set epsilon1 to (1-boaParams->epsilon)      epsilon1 = 1-boaParams->epsilon;      // are all frequencies closer than epsilon to either 0 or 1?      result=EPSILON_TERMINATION;      for (k=0; k<populationStatistics.n; k++)	if ((populationStatistics.p1[k]>=boaParams->epsilon)&&(populationStatistics.p1[k]<=epsilon1))	  result=0;    };  // check if the number of generations wasn't exceeded  if ((!result)&&(boaParams->maxGenerations>=0))    result = (populationStatistics.generation>=boaParams->maxGenerations)? MAXGENERATIONS_TERMINATION:0;  // get back  return result;};// ================================================================================//// name:          generateOffspring//// function:      generates offspring in the BOA (constructs the network for the//                selected strings, and then uses it to generate new strings) //// parameters:    t............the number of current generation//                parents......the selected set of promising strings//                offspring....the resulting population of offspring//                boaParams....the parameters sent to the BOA//// returns:       (int) 0//// ================================================================================int generateOffspring(long t, Population *parents, Population *offspring, BoaParams *boaParams){  AcyclicOrientedGraph *G;  // initialize the network (to an empty network)  G = new AcyclicOrientedGraph(parents->n);  // construct the Bayesian network to model the selected set of parents  constructTheNetwork(parents,G,boaParams);  // print out the model for this generation  printModel(modelFile,t,G);  // generate the new points  generateNewInstances(parents,offspring,G,boaParams);  // delete the network  delete G;  // get back  return 0;};// ================================================================================//// name:          pause//// function:      waits for enter key if required//// parameters:    (none)//// returns:       (int) 0//// ================================================================================int pause(BoaParams *boaParams){  if (boaParams->pause)    {      printf("Press Enter to continue.");      getchar();    };  return 0;};// ================================================================================//// name:          done//// function:      gets back to normal what was changed in initialization of the BOA//// parameters:    boaParams....the parameters sent to the BOA//// returns:       (int) 0//// ================================================================================int done(BoaParams *boaParams){  // get rid of the metric  doneMetric();  // get rid of the fitness  doneFitness(boaParams);  // statistics done  doneBasicStatistics(&populationStatistics);  // close output streams  if (logFile)    fclose(logFile);  if (fitnessFile)    fclose(fitnessFile);  if (modelFile)    fclose(modelFile);     // get back  return 0;  };// ================================================================================//// name:          getLogFile//// function:      returns a pointer to the log file strea//// parameters:    (none)//// returns:       (FILE*) a pointer to the log file stream//// ================================================================================FILE *getLogFile(){  return logFile;};// ================================================================================//// name:          getModelFile//// function:      returns a pointer to the model file stream//// parameters:    (none)//// returns:       (FILE*) a pointer to the model file stream//// ================================================================================FILE *getModelFile(){  return modelFile;};// ================================================================================//// name:          getFitnessFile//// function:      returns a pointer to the fitness file stream//// parameters:    (none)//// returns:       (FILE*) a pointer to the fitness file stream//// ================================================================================FILE *getFitnessFile(){  return fitnessFile;};

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩午夜电影在线观看| 国产精品国产三级国产普通话99| 国产成人aaa| 亚洲chinese男男1069| 欧美激情一区在线观看| 制服丝袜一区二区三区| 91香蕉视频污在线| 国产一区二区电影| 日本成人中文字幕在线视频| 尤物av一区二区| 亚洲国产高清在线观看视频| 日韩欧美激情四射| 欧美三级三级三级爽爽爽| 99riav一区二区三区| 国产乱理伦片在线观看夜一区| 视频在线观看国产精品| 亚洲精品欧美二区三区中文字幕| 国产人久久人人人人爽| 精品成人一区二区三区四区| 欧美日韩国产欧美日美国产精品| 91亚洲精品乱码久久久久久蜜桃| 国产乱子伦视频一区二区三区| 日韩福利视频网| 亚洲国产精品一区二区久久| 亚洲免费观看高清| 亚洲私人黄色宅男| 国产精品久久久久久福利一牛影视| 26uuu精品一区二区三区四区在线| 3atv在线一区二区三区| 欧美日韩国产123区| 日本高清不卡在线观看| 色妞www精品视频| 91无套直看片红桃| 91天堂素人约啪| 波多野结衣中文一区| 暴力调教一区二区三区| jizz一区二区| 91视频com| 日本电影亚洲天堂一区| 91久久精品日日躁夜夜躁欧美| 9i看片成人免费高清| 99久久精品国产观看| 99久久国产综合精品女不卡| 色综合天天天天做夜夜夜夜做| 91在线视频网址| 91国偷自产一区二区三区成为亚洲经典 | 欧美精品一区二区在线观看| 日韩欧美的一区| www久久精品| 中文字幕欧美国产| 亚洲婷婷综合久久一本伊一区| 国产精品激情偷乱一区二区∴| 中文一区二区完整视频在线观看 | 亚洲精品国产a久久久久久 | 国产精品一区二区你懂的| 国产精品亚洲综合一区在线观看| 国产成人在线视频网址| 成人动漫一区二区在线| 在线欧美日韩精品| 7777精品伊人久久久大香线蕉| 欧美成人精品福利| 日本一区二区在线不卡| 一区二区三区中文字幕| 日韩精品乱码av一区二区| 狠狠色丁香婷婷综合| 成人久久18免费网站麻豆| 色诱亚洲精品久久久久久| 欧美片网站yy| 久久夜色精品国产欧美乱极品| 国产精品入口麻豆原神| 亚洲国产一二三| 久久不见久久见中文字幕免费| 成人激情动漫在线观看| 欧美性做爰猛烈叫床潮| 欧美成人伊人久久综合网| 国产精品久久久久久久久久久免费看| 亚洲综合视频在线观看| 精品亚洲国产成人av制服丝袜| 成人免费视频app| 欧美三级午夜理伦三级中视频| 久久无码av三级| 亚洲男人的天堂在线观看| 蜜桃av一区二区| 色综合色狠狠综合色| 精品久久久久99| 亚洲激情自拍偷拍| 国产一区二区三区久久久| 欧美视频三区在线播放| 久久久久久久久伊人| 亚洲18色成人| 99久久伊人精品| 日韩一卡二卡三卡| 亚洲精品一二三四区| 国产河南妇女毛片精品久久久| 欧美日韩一级二级三级| 中文字幕一区二区不卡| 美女看a上一区| 色狠狠一区二区三区香蕉| 久久久久久麻豆| 石原莉奈一区二区三区在线观看| 成人av在线播放网站| 日韩欧美综合一区| 亚洲一级二级在线| 99在线热播精品免费| 精品国产精品网麻豆系列| 亚洲国产成人精品视频| jiyouzz国产精品久久| 26uuu欧美| 蜜桃视频一区二区三区 | 欧美国产成人精品| 久久成人精品无人区| 欧美日韩国产经典色站一区二区三区 | 国产二区国产一区在线观看| 666欧美在线视频| 亚洲一区二区中文在线| 91一区在线观看| 中文字幕成人在线观看| 国产精品自在欧美一区| 欧美一区二区三区在线观看视频 | 福利视频网站一区二区三区| 日韩欧美成人午夜| 免费三级欧美电影| 欧美日韩激情一区二区| 亚洲第一综合色| 欧美综合一区二区| 樱花草国产18久久久久| 91碰在线视频| 亚洲欧美日韩一区二区三区在线观看| 国产91丝袜在线播放| 国产日产欧美精品一区二区三区| 国产一区二区三区四区五区美女 | 欧美日本国产视频| 午夜欧美一区二区三区在线播放| 精品视频免费在线| 亚洲电影在线免费观看| 在线不卡中文字幕| 日本不卡视频在线| 日韩欧美在线1卡| 精品一区精品二区高清| 精品久久久久久久久久久久久久久 | 在线视频观看一区| 亚洲午夜久久久久中文字幕久| 欧美日韩免费高清一区色橹橹| 亚洲chinese男男1069| 欧美一区二区在线看| 久久精品国产免费看久久精品| 欧美一区二区三区思思人| 蜜臀av性久久久久蜜臀aⅴ四虎 | 麻豆精品视频在线观看视频| 日韩三级中文字幕| 国产成人免费xxxxxxxx| 中文字幕在线一区二区三区| 色综合中文字幕| 亚瑟在线精品视频| 精品久久久久久久久久久久包黑料 | 欧美一区二区三区在线| 精品一区二区三区免费毛片爱| 国产性色一区二区| 99re成人精品视频| 五月天欧美精品| 精品裸体舞一区二区三区| 国产**成人网毛片九色| 伊人夜夜躁av伊人久久| 欧美一区在线视频| 国产成a人亚洲| 亚洲综合色成人| 26uuu成人网一区二区三区| 91小宝寻花一区二区三区| 亚洲成人精品在线观看| xfplay精品久久| 色94色欧美sute亚洲线路一久 | 国产专区欧美精品| 中文字幕中文在线不卡住| 欧美精品1区2区| 国产成人免费在线观看不卡| 亚洲欧美电影一区二区| 日韩午夜在线观看| 99久久伊人网影院| 美女视频黄久久| 亚洲人成精品久久久久| 日韩一区二区三区四区| 97久久超碰国产精品| 日韩经典中文字幕一区| 国产精品色婷婷久久58| 在线电影欧美成精品| 丁香婷婷深情五月亚洲| 日韩综合一区二区| 国产精品国产三级国产aⅴ无密码| 91麻豆精品国产综合久久久久久| 风间由美一区二区av101| 日本最新不卡在线| 亚洲人成网站精品片在线观看| 精品少妇一区二区三区| 欧美性大战久久久久久久蜜臀| 国产不卡高清在线观看视频| 奇米影视在线99精品| 亚洲精品欧美激情| 日本一区二区三区在线观看| 日韩精品专区在线| 在线观看日韩毛片|