资源简介
设定障碍物,通过蚁群算法完成路径规划!

代码片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% 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)
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
- 上一篇:基于蚁群算法的多机器人路径规划
- 下一篇:西门子PCS7仿真手册
相关资源
- 基于蚁群算法的开采沉陷计算参数反
- 基于蚁群算法优化SVM的瓦斯涌出量预
- 蚁群算法论文合集
- 蚁群算法模型美赛B题C问,可直接调用
- 基于改进蚁群算法的车间调度研究方
- 基于蚁群算法优化控制的研究及其在
- 基于改进蚁群算法的QoS组播路由问题
- 连续域蚁群算法
- 智能优化算法蚁群算法、狼群算法、
- 蚁群算法在机器人路径规划中的应用
- 蚁群算法.ppt蚁群算法.ppt
- 蚁群算法-车辆路径问题
- 线程池实现蚁群算法的简单并行
- 数学建模方法:蚁群算法
- Ant Colony Optimization书籍-英文版中文版
- 蚁群算法原理及其应用+2005[1].pdf,4
- 蚁群算法原理和应用段海滨版.pdf
- 蚁群算法原理及其应用.pdf
- 蚁群算法原理及其应用(完整版.高清
- 蚁群算法在配电网重构中的应用 书籍
- 蚁群算法原理及应用_段海滨_高清
- 车辆路径问题蚁群算法
- 蚁群算法研究综述 发展历史和特点
- 基于蚁群算法的二维路径规划算法
- 蚁群算法-TSP旅行商
- 基于蚁群算法的三维路径规划算法
- 蚁群算法的三维路径寻优
- 各种智能算法程序以求函数最值为例
- 多约束下多车场车辆路径问题的蚁群
- eil51.tsp.txt
评论
共有 条评论