資源簡介
多目標蟻群算法,蟻群算法(ant colony optimization, ACO),又稱螞蟻算法,是一種用來在圖中尋找優化路徑的機率型算法。
代碼片段和文件信息
%初始化函數
ant_n=50;
city_n=30;
NC=200;
tobu(ant_ncity_n)=0;
ph_table(city_ncity_n)=0;
hu_table(city_ncity_n)=0;
a=3;
b=1;
dispose=0.2;
everbest=inf;
adapt_ave(NC)=0;
adapt_best(NC)=inf;
%計算城市距離矩陣
for?i=1:city_n
????for?j=1:city_n
????????x1=pos(i1);
????????y1=pos(i2);
????????x2=pos(j1);
????????y2=pos(j2);
????????
????????dis_table(ij)=sqrt((x1-x2)^2+(y1-y2)^2);
????end
end
for?i=1:city_n
????dis_table(ii)=inf;
end
%初始化啟發式分布表
for?i=1:city_n
????for?j=1:city_n
????????hu_table(ij)=100/dis_table(ij);
????end
end
%初始化信息素
for?i=1:city_n
????for?j=1:city_n
????????ph_table(ij)=0.5;????%額定信息素取值為0~1
????end
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????703??2008-03-13?13:27??多目標蟻群算法\initial.m
?????文件????????189??2005-12-15?20:07??多目標蟻群算法\keepbest.m
?????文件???????1073??2005-12-16?09:37??多目標蟻群算法\paint.m
?????文件?????????42??2005-12-15?15:53??多目標蟻群算法\result.m
?????文件???????1035??2005-12-16?13:16??多目標蟻群算法\search.m
?????目錄??????????0??2015-08-15?18:31??多目標蟻群算法
-----------?---------??----------?-----??----
?????????????????3042????????????????????6
- 上一篇:cw_vrp 節約算法
- 下一篇:matlab飛行仿真
評論
共有 條評論