首页 > 行业资讯 > 【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附matlab代码

【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附matlab代码

时间:2022-04-08 来源: 浏览:

【PRM路径规划】基于PRM采样结合粒子群和蚁群算法实现机器人障碍路径规划附matlab代码

天天Matlab 天天Matlab
天天Matlab

TT_Matlab

博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,完整matlab代码或者程序定制加qq1575304183。

收录于话题 #路径规划matlab源码 307个

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代码问题可私信交流。

部分理论引用网络文献,若有侵权联系博主删除。

版权:如无特殊注明,文章转载自网络,侵权请联系cnmhg168#163.com删除!文件均为网友上传,仅供研究和学习使用,务必24小时内删除。
相关推荐