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

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

?? hc-mmas-ubqp.cpp

?? The software package provides a MAX-MIN Ant System implemented in the Hyper-Cube Framework for the
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/***************************************************************************                          hc-mmas-ubqp.cpp  -  description                             -------------------    begin                : Fri Mar 21 15:46:28 CET 2003    copyright            : (C) 2003 by Christian Blum    email                : cblum@ulb.ac.be ***************************************************************************//***************************************************************************    Program's name: hc-mmas-ubqp    Ant Colony Optimization algorithm to tackle     Unary Binary Quadratic Programming    Copyright (C) 2003  Christian Blum    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation; either version 2 of the License, or    (at your option) any later version.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program; if not, write to the Free Software    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    Author's contact details:     email: cblum@ulb.ac.be    mail address: Universite Libre de Bruxelles, IRIDIA,                  Av. Franklin Roosevelt 50, CP 194/6,                  B-1050 Brussels, Belgium ***************************************************************************/#ifdef HAVE_CONFIG_H#include <config.h>#endif#include "Timer.h"#include "Unconstrained_Ant.h"#include "Random.h"#include "utilstuff.h"#include "Solution.h"#include <string>#include <list>// the following five variables are involved in termination criteria issuesint n_of_iter = 1000;double time_limit = 100.0;bool time_limit_given = false;bool iter_limit_given = false;bool input_file_given = false;// problem_size: number of variables of the problem instanceint problem_size;// n_of_ants: the number of antslong int n_of_ants = 10;// l_rate: the learning rate (used for updating the pheromone values)double l_rate = 0.05;// tau_min, tau_max: lower, respecively upper, limit for the pheromone valuesdouble tau_min = 0.001;double tau_max = 0.999;// n_of_trials: the number of trials that is to be executed for the given problem instanceint n_of_trials = 1;// ls: usage of local searchbool ls = true;// ants: the list of antslist<Unconstrained_Ant*> ants;// q_matrix: the matrix that specifies the problem instance (as read from the instance file)double** q_matrix;// c_const: we add c_const to every objective function value in order to have all positive objective function valuesdouble c_const;// pheromone: the structure that holds the pheromone valuesmap<int,pair<double,double> >* pheromone;// t: a variable that is involved in initializing the random generatortime_t t;// rnd: a random generatorRandom* rnd;/* The method readFile is used to read the problem specification from a file */void readFile(string fileName) {  FILE* inputFile = fopen(fileName.c_str(), "r");  if (fscanf(inputFile, "%ld", &problem_size) < 0) {    printf("error reading problem size.\n");    exit(1);  }    q_matrix = DoubleMatrixAlloc(problem_size,problem_size);  for (int i = 0; i < problem_size; i++) {    for (int j = 0; j < problem_size; j++) {      q_matrix[i][j] = 0.0;    }  }  int entries;  if (fscanf(inputFile, "%ld", &entries) < 0) {    printf("error reading number of entries.\n");    exit(1);  }      if (fscanf(inputFile, "%lf", &c_const) < 0) {    printf("error reading c_const.\n");    exit(1);  }      for (int i = 0; i < entries; i++) {    int pos1;    int pos2;    double val;    if (fscanf(inputFile, "%ld", &pos1) < 0) {      printf("error reading first position.\n");      exit(1);    }    if (fscanf(inputFile, "%ld", &pos2) < 0) {      printf("error reading second position.\n");      exit(1);    }    if (fscanf(inputFile, "%lf", &val) < 0) {      printf("error reading value.\n");      exit(1);    }    q_matrix[pos1][pos2] = val;    q_matrix[pos2][pos1] = val;  }}/* The method read_parameters is used to read-in the command line parameters */void read_parameters(int argc, char **argv){  int iarg=1;  while (iarg < argc)  {    if (strcmp(argv[iarg],"-i")==0) {      readFile(argv[++iarg]);      input_file_given = true;    }    else if (strcmp(argv[iarg],"-t")==0) {       time_limit=atof(argv[++iarg]);      time_limit_given = true;    }    else if (strcmp(argv[iarg],"-maxiter")==0) {      n_of_iter=atoi(argv[++iarg]);      iter_limit_given = true;    }    else if (strcmp(argv[iarg],"-nants")==0) {      n_of_ants = atoi(argv[++iarg]);    }    else if (strcmp(argv[iarg],"-lrate")==0) {      l_rate = atof(argv[++iarg]);    }    else if (strcmp(argv[iarg],"-n")==0) {      n_of_trials=atoi(argv[++iarg]);    }    else if (strcmp(argv[iarg],"-ls")==0) {      if (strcmp(argv[++iarg],"yes")==0) {	ls = true;      }      else {	ls = false;      }    }    iarg++;  }  if (input_file_given == false) {    printf("No input file given.");    printf("\n");    exit(1);  }  if ((time_limit_given == false) && (iter_limit_given == false)) {    cout << endl;    cout << "please specify:" << endl;    cout << endl;    cout << "* a time limit (i.e., -t 20.0), or" << endl;    cout << "* an iteration limit (i.e., -maxiter 1000), or" << endl;    cout << "* both" << endl;    cout << endl;    exit(1);  }}/* The method getBestSolutionInIteration can be called after each ant has produced a solution.    The method returns the best one among the current solutions produced by the ants */Solution* getBestSolutionInIteration() {  Solution* sol;  bool start = true;  for (list<Unconstrained_Ant*>::iterator anAnt = ants.begin(); anAnt != ants.end(); anAnt++) {    if (start) {      start = false;      sol = (*anAnt)->constructed_solution;    }    else {      Solution* current = (*anAnt)->constructed_solution;      if ((*current).quality > (*sol).quality) {	sol = current;      }    }  }  return sol->copy();}/* The method getIterationAverage can be called after each ant has produced a solution.    The method returns the average objective function values of the current solutions produced by the ants */double getIterationAverage() {  double ret_val = 0.0;  for (list<Unconstrained_Ant*>::iterator anAnt = ants.begin(); anAnt != ants.end(); anAnt++) {    ret_val = ret_val + ((double)((*anAnt)->constructed_solution)->quality);  }  return (ret_val / (double)n_of_ants);}/* The method resetUniformPheromoneValues initializes (or resets) all the pheromone values to 0.5 */void resetUniformPheromoneValues() {  for (int i = 0; i < problem_size; i++) {    (*pheromone)[i].first = 0.5;    (*pheromone)[i].second = 0.5;  }}/* The method computeConvergenceFactor computes the convergence factor cf, which gives an   indication about the current state of the system in terms of its convergence */double computeConvergenceFactor() {  double ret_val = 0.0;  for (int i = 0; i < problem_size; i++) {    if ((tau_max - (*pheromone)[i].first) > ((*pheromone)[i].first - tau_min)) {      ret_val = ret_val + tau_max - (*pheromone)[i].first;    }    else {      ret_val = ret_val + (*pheromone)[i].first - tau_min;    }    if ((tau_max - (*pheromone)[i].second) > ((*pheromone)[i].second - tau_min)) {      ret_val = ret_val + tau_max - (*pheromone)[i].second;    }    else {      ret_val = ret_val + (*pheromone)[i].second - tau_min;    }  }  ret_val = ret_val / (2.0 * ((double)problem_size) * (tau_max - tau_min));  ret_val = (ret_val - 0.5) * 2.0;  return ret_val;}/* 'main' is the main body of the program */int main( int argc, char **argv ) {  // first the command line parameters have to be read  if ( argc < 2 ) {    exit(1);  }  else {    read_parameters(argc,argv);  }  // initialization of the random generator (using the current time)  rnd = new Random((unsigned) time(&t));  // initialization of the structure that holds the pheromone values  pheromone = new map<int,pair<double,double> >;  /* initialization of the list of ants (as information they receive the problem size,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区黄视频 | 成人国产精品免费网站| 日韩国产欧美在线观看| 午夜视频久久久久久| 亚洲国产日韩av| 亚洲123区在线观看| 亚洲一区av在线| 石原莉奈在线亚洲三区| 日韩激情视频在线观看| 理论电影国产精品| 国内精品免费**视频| 国产成人综合在线观看| 国产91精品露脸国语对白| 国产精品18久久久久久久久| 国产成人a级片| 99精品欧美一区| 在线免费观看一区| 911精品国产一区二区在线| 日韩亚洲欧美一区二区三区| 久久久九九九九| 一片黄亚洲嫩模| 视频一区欧美日韩| 国内外精品视频| 99免费精品在线| 欧美亚日韩国产aⅴ精品中极品| 欧美日韩精品欧美日韩精品| 欧美一级生活片| 国产日产欧美一区二区视频| 中文字幕在线视频一区| 亚洲尤物视频在线| 理论片日本一区| 成人动漫视频在线| 欧美中文字幕一区二区三区亚洲| 91精品中文字幕一区二区三区| 久久综合色之久久综合| 亚洲码国产岛国毛片在线| 日本中文字幕一区| 国产成人综合在线播放| 欧美影院午夜播放| 精品国产乱码久久久久久闺蜜| 国产精品素人一区二区| 亚洲成人激情av| 国产成人免费视频精品含羞草妖精| 色女孩综合影院| 欧美第一区第二区| 亚洲精品菠萝久久久久久久| 美国av一区二区| 一本久久a久久精品亚洲| 欧美一区二区高清| 综合av第一页| 激情欧美一区二区| 欧美主播一区二区三区| 久久精品日韩一区二区三区| 亚洲国产精品尤物yw在线观看| 国产乱子轮精品视频| 欧美乱妇20p| **性色生活片久久毛片| 久久疯狂做爰流白浆xx| 91黄色小视频| 国产人久久人人人人爽| 奇米一区二区三区av| 91视频免费播放| 国产日韩欧美一区二区三区乱码| 午夜电影久久久| 91欧美一区二区| 国产日韩欧美精品在线| 蓝色福利精品导航| 欧美在线一区二区三区| 中文字幕 久热精品 视频在线 | 久久99精品国产.久久久久 | 亚洲综合一二三区| 成人久久18免费网站麻豆| 欧美成人激情免费网| 国产精品自拍三区| 欧美猛男超大videosgay| 日韩美女视频一区二区| 国产成人一级电影| 2021中文字幕一区亚洲| 日韩福利视频导航| 欧美视频中文字幕| 亚洲日本一区二区| 成人国产精品免费观看| 国产午夜精品理论片a级大结局 | 国产精品亚洲а∨天堂免在线| 9191成人精品久久| 亚洲国产欧美日韩另类综合 | 成人一级黄色片| 亚洲精品视频一区二区| 91精品国产综合久久久久| 亚洲最大的成人av| 91啪亚洲精品| 亚洲精品你懂的| 色吧成人激情小说| 亚洲免费在线电影| 91浏览器打开| 一区二区三区产品免费精品久久75| 成人开心网精品视频| 国产精品成人一区二区艾草 | 99天天综合性| 中文字幕在线观看一区| 成年人国产精品| 亚洲欧美色综合| 在线观看一区二区精品视频| 亚洲一区在线观看免费 | 亚洲男人的天堂网| 色88888久久久久久影院野外| 亚洲精品第1页| 欧美无乱码久久久免费午夜一区| 亚洲已满18点击进入久久| 欧美亚日韩国产aⅴ精品中极品| 亚洲综合另类小说| 欧美日韩第一区日日骚| 香蕉av福利精品导航| 91精品国产91久久久久久一区二区 | 五月婷婷久久综合| 日韩一级片网站| 国产精一品亚洲二区在线视频| 久久精品免视看| av日韩在线网站| 亚洲午夜国产一区99re久久| 欧美日韩日日摸| 美女视频网站久久| 久久理论电影网| 色综合婷婷久久| 天堂久久久久va久久久久| 精品伦理精品一区| 成人一级片在线观看| 一区二区三区在线不卡| 欧美一区二区三区视频在线观看 | 91亚洲精品一区二区乱码| 亚洲高清视频的网址| 日韩欧美一区中文| 成人精品小蝌蚪| 亚洲国产精品自拍| 亚洲精品一区二区三区香蕉| 97精品国产露脸对白| 亚洲第一二三四区| 国产视频在线观看一区二区三区| 91香蕉视频污| 蜜臀精品久久久久久蜜臀| 国产精品久久久久婷婷| 911精品产国品一二三产区| 国产传媒日韩欧美成人| 一区二区三区**美女毛片| 欧美电影免费观看高清完整版在 | 在线电影院国产精品| 国产一区二区三区久久久| 一区二区三区日韩欧美精品| 日韩欧美亚洲一区二区| 91亚洲精品乱码久久久久久蜜桃| 免费成人深夜小野草| 国产精品二三区| 日韩欧美国产不卡| 91看片淫黄大片一级在线观看| 美女国产一区二区三区| 亚洲欧洲日韩女同| 日韩限制级电影在线观看| 91丨九色porny丨蝌蚪| 精品亚洲成a人在线观看| 亚洲午夜精品久久久久久久久| 国产午夜精品一区二区 | 亚洲激情网站免费观看| 精品久久久久久久久久久院品网| 91免费观看视频| 国产精品一区三区| 日韩在线一二三区| 亚洲精品亚洲人成人网在线播放| 日韩免费视频一区二区| 日本高清无吗v一区| 国产美女久久久久| 免费在线观看成人| 夜夜嗨av一区二区三区网页| 中文一区在线播放| 亚洲精品一区二区三区影院| 欧美人xxxx| 欧美手机在线视频| 91蜜桃在线观看| 成人国产精品免费观看动漫| 国内精品久久久久影院色| 成人一区在线看| 久久精品国产澳门| 视频一区在线播放| 亚洲国产aⅴ成人精品无吗| 自拍视频在线观看一区二区| 欧美国产欧美综合| 精品国产一区二区三区不卡| 欧美一区二区性放荡片| 欧美久久一区二区| 欧美日韩久久久久久| 欧洲在线/亚洲| 色婷婷av一区二区三区大白胸 | 欧美精品 日韩| 在线观看日韩电影| 在线亚洲免费视频| 91欧美一区二区| 色综合久久六月婷婷中文字幕| 成人亚洲一区二区一| 国产91清纯白嫩初高中在线观看 | 在线一区二区三区四区五区| 91香蕉国产在线观看软件|