【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附matlab代码
【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附matlab代码
TT_Matlab
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,完整matlab代码或者程序定制加qq1575304183。
1 简介
2 部分代码
%% ABC + PSO Path Planning Problem
% Here, system tries to find the most optimal path between starting point
% and destination point with aid of Artificial Bee Colony (ABC) algorithm
% and Particle Swarm Optimization algorithm combined. It is good strategy
% in robotics path finding. In each run new obstacles in new positions
% defines and a curved line tries to find the best path. Run multiple times
% to find the best result.
% Hope this code help you :)
%% Cleaning The Stage
clc;
clear;
warning(’off’);
%% Start ABC + PSO Optimal Path Finder
model=Basics();
model.n=6; % number of Handle Points
CostFunction=@(x) Cost(x,model); % Cost Function
nVar=model.n; % Number of Decision Variables
VarSize=[1 nVar]; % Size of Decision Variables Matrix
VarMin.x=model.xmin; % Lower Bound of Variables
VarMax.x=model.xmax; % Upper Bound of Variables
VarMin.y=model.ymin; % Lower Bound of Variables
VarMax.y=model.ymax; % Upper Bound of Variables
%% PSO + ABC Parameters
MaxIt=150; % Maximum Number of Iterations
nPop=20; % Population Size (Swarm Size)
w=1; % Inertia Weight
wdamp=0.98; % Inertia Weight Damping Ratio
c1=1.5; % Personal Learning Coefficient
end
end
% Update Best Solution Ever Found
for i = 1:nPop
if pop(i).Cost <= BestSol.Cost
BestSol = pop(i);
end
end
tOfTheRange)=-particle(i).Velocity.y(OutOfTheRange);
% Update Position Bounds
particle(i).Position.y = max(particle(i).Position.y,VarMin.y);
particle(i).Position.y = min(particle(i).Position.y,VarMax.y);
%
Flag=[’, Violation = ’ num2str(GlobalBest.Sol.Violation)];
end
disp([’In Iteration Number ’ num2str(it) ’:ABC+PSO Fittest Value Is = ’ num2str(BestCost(it)) Flag]);
% Plot Solution
figure(1);
Plotting(GlobalBest.Sol,model);
pause(0.01);
end
%% Plot Train Stage
figure;
plot(sort(BestCost,’descend’),’r.’,’LineWidth’,3);
title (’ABC + PSO Training’);
xlabel(’Itr’);
ylabel(’ABC+PSO Fittest Value’);
grid on;
3 仿真结果
4 参考文献
[1]宋彬. 结合粒子群算法和改进蚁群算法的机器人混合路径规划[D]. 中国矿业大学.
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,相关matlab代码问题可私信交流。
部分理论引用网络文献,若有侵权联系博主删除。
-
2023年血糖新标准公布,不是3.9-6.1,快来看看你的血糖正常吗? 2023-02-07
-
2023年各省最新电价一览!8省中午执行谷段电价! 2023-01-03
-
GB 55009-2021《燃气工程项目规范》(含条文说明),2022年1月1日起实施 2021-11-07
-
PPT导出高分辨率图片的四种方法 2022-09-22
-
2023年最新!国家电网27家省级电力公司负责人大盘点 2023-03-14
-
全国消防救援总队主官及简历(2023.2) 2023-02-10
-
盘点 l 中国石油大庆油田现任领导班子 2023-02-28
-
我们的前辈!历届全国工程勘察设计大师完整名单! 2022-11-18
-
关于某送变电公司“4·22”人身死亡事故的快报 2022-04-26
