91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 5KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-02
  • 語言: 其他
  • 標簽: 蟻群算法??

資源簡介

設定障礙物,通過蟻群算法完成路徑規劃!

資源截圖

代碼片段和文件信息

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%?Ant?system?(AS)?for?TSP.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear?all;
close?all
clc;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?Data
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
nodesLocation?=?LoadNodesLocations();
trackWidth?=?5;
numberOfSection?=?length(nodesLocation)/trackWidth;
nodesFriction?=??ones(150);
i?=?[11?12?19?20?26?27?33?34?47?48?49?50];
nodesFriction(i)?=?99;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?Parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
numberOfAnts?=?50;??%?To?do:?Set?to?appropriate?value.
alpha?=?1.0;????????%?To?do:?Set?to?appropriate?value.
beta?=?5.0;?????????%?To?do:?Set?to?appropriate?value.
rho?=?0.5;??????????%?To?do:?set?to?appropriate?value.

nearestNeighbourPathLength?=?GetNearestNeighbourPathLength(nodesLocation?nodesFriction?trackWidth);
tau0?=?numberOfAnts/nearestNeighbourPathLength;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Initialization
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

range?=?[0?20?0?20];
tspFigure?=?InitializeTspPlot(nodesLocation?range);
connection?=?InitializeConnections(nodesLocation?nodesLocation?nodesFriction);
pheromoneLevel?=?InitializePheromoneLevels(length(nodesLocation)?tau0);?

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?Main?loop
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
minimumPathLength?=?inf;

iIteration?=?0;
targetPathLength?=?0;

while?(minimumPathLength?>?targetPathLength)
?iIteration?=?iIteration?+?1;

?%%%%%%%%%%%%%%%%%%%%%%%%%%
?%?Generate?paths:
?%%%%%%%%%%%%%%%%%%%%%%%%%%

?pathCollection?=?[];
?pathLengthCollection?=?[];
?for?k?=?1:numberOfAnts
??[path?pathLength]?=?GeneratePath(pheromoneLevel?alpha?beta?trackWidth?nodesLocation?nodesFriction);
?????????????????
??if?(pathLength?????minimumPathLength?=?pathLength;
????disp(sprintf(‘Iteration?%d?ant?%d:?path?length?=?%.5f‘iIterationkminimumPathLength));
????PlotPath(connectionnodesLocationpath?trackWidth);
????bestPath?=?path;
??end
??pathCollection?=?[pathCollection;?path];???????????
??pathLengthCollection?=?[pathLengthCollection;?pathLength];
?end

?%%%%%%%%%%%%%%%%%%%%%%%%%%
?%?Update?pheromone?levels
?%%%%%%%%%%%%%%%%%%%%%%%%%%

?deltaPheromoneLevel?=?ComputeDeltaPheromoneLevels(pathCollectionpathLengthCollection?trackWidth);??%?To?do:?write?the?ComputeDeltaPheromoneLevels?function
?pheromoneLevel?=?UpdatePheromoneLevels(pheromoneLeveldeltaPheromoneLevelrho);??????????%?To?do:?write?the?UpdatePheromoneLevels?function

end







?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????2555??2018-02-06?20:00??AntRace-master\AntRace-master\AntSystem.m

?????文件????????824??2018-02-06?20:00??AntRace-master\AntRace-master\ComputeDeltaPheromoneLevels.m

?????文件?????????88??2018-02-06?20:00??AntRace-master\AntRace-master\EuclidianDistance.m

?????文件????????668??2018-02-06?20:00??AntRace-master\AntRace-master\GeneratePath.m

?????文件????????853??2018-02-06?20:00??AntRace-master\AntRace-master\GetNearestNeighbourPathLength.m

?????文件???????1360??2018-02-06?20:00??AntRace-master\AntRace-master\GetNode.m

?????文件????????280??2018-02-06?20:00??AntRace-master\AntRace-master\InitializeConnections.m

?????文件????????136??2018-02-06?20:00??AntRace-master\AntRace-master\InitializePheromoneLevels.m

?????文件????????355??2018-02-06?20:00??AntRace-master\AntRace-master\InitializeTspPlot.m

?????文件????????177??2018-02-06?20:00??AntRace-master\AntRace-master\LoadNodesLocations.m

?????文件????????751??2018-02-06?20:00??AntRace-master\AntRace-master\NearestNeighbourg.m

?????文件????????311??2018-02-06?20:00??AntRace-master\AntRace-master\PlotPath.m

?????文件????????392??2018-02-06?20:00??AntRace-master\AntRace-master\README.md

?????文件????????162??2018-02-06?20:00??AntRace-master\AntRace-master\UpdatePheromoneLevels.m

?????目錄??????????0??2018-09-28?08:08??AntRace-master\AntRace-master

?????目錄??????????0??2018-09-28?08:08??AntRace-master

-----------?---------??----------?-----??----

?????????????????8912????????????????????16


評論

共有 條評論