資源簡介
fashionxu.blogchina.com上面的蟻群算法源代碼,用C++實現。
代碼片段和文件信息
//?aco.cpp?:?定義控制臺應用程序的入口點。
//
#include?“stdafx.h“
#include?“stdafx.h“
#include?
#include?
#include?“math.h“
#include??
using?namespace?std;
const?int?iAntCount=10;//ant?numbers
const?int?iCityCount=48;
const?int?iItCount=5000;
const?double?Q=100;
const?double?alpha=3.0;
const?double?beta=5.0;
const?double?rou=0.9;
const?double?rain=0.022;
const?double?q0=0.3;
int?besttour[iCityCount+1];
double??rnd(int?lowint?uper)
{
double?p=(rand()/(double)RAND_MAX)*((uper)-(low))+(low);
//if?(p==1)p=0.9999;
//else?if?(p==0)p=0.0001;
return?(p);
};
int?rnd(int?uper)
{
return?(rand()%uper);
};
struct?GInfo
{
double?m_dDeltTrial[iCityCount][iCityCount];
double?m_dTrial[iCityCount][iCityCount];
double?distance[iCityCount][iCityCo
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3809??2005-11-19?19:15??aco\aco.vcproj
?????文件??????35840??2006-03-15?15:48??aco\aco.ncb
?????文件????????967??2005-11-19?19:15??aco\ReadMe.txt
?????文件????????195??2005-11-19?19:15??aco\stdafx.h
?????文件????????207??2005-11-19?19:15??aco\stdafx.cpp
?????文件???????6828??2005-11-21?22:20??aco\aco.cpp
?????文件????????895??2005-11-19?19:15??aco\aco.sln
????..A..H.??????8192??2006-03-15?15:48??aco\aco.suo
?????文件????????443??2005-11-18?09:58??aco\eil51.tsp
?????文件????????602??2005-11-18?09:29??aco\48.txt
?????目錄??????????0??2005-11-19?19:15??aco
-----------?---------??----------?-----??----
????????????????57978????????????????????11
- 上一篇:編譯原理簡單的詞法分析器
- 下一篇:基于MFCC和GMM的說話人識別
評論
共有 條評論