首页 > 行业资讯 > 【路径规划】基于狼群算法之三维路径规划matlab源码

【路径规划】基于狼群算法之三维路径规划matlab源码

时间:2022-06-22 来源: 浏览:

【路径规划】基于狼群算法之三维路径规划matlab源码

原创 天天Matlab 天天Matlab
天天Matlab

TT_Matlab

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

收录于合集 #路径规划matlab源码 354个

1 基于狼群算法之三维路径规划模型

4 部分代码

%% 清空环境 clc clear all close all %% 数据初始化 %下载数据 load   HeightData % HeightData=HeightData’; %网格划分 LevelGrid = 10 ; PortGrid = 21 ; %起点终点网格点 starty = 6 ; starth = 1 ; endy = 8 ; endh = 21 ; m = 1 ; %算法参数 PopNumber = 10 ;         %种群个数 BestFitness =[];     %最佳个体 iter = 100 ; %初始信息素 pheromone = ones ( 21 , 21 , 21 ); dim = PortGrid * 2 ; Max_iter = 100 ; ub = PortGrid ; lb = 1 ; % initialize alpha, beta, and delta_pos Alpha_pos = zeros ( 1 , dim ); Alpha_score = inf ; %change this to -inf for maximization problems Beta_pos = zeros ( 1 , dim ); Beta_score = inf ; %change this to -inf for maximization problems Delta_pos = zeros ( 1 , dim ); Delta_score = inf ; %change this to -inf for maximization problems %Initialize the path of search agents Convergence_curve = zeros ( 1 , Max_iter ); l = 0 ; % Loop counter %% 初始搜索路径 [ path , pheromone ]= searchpath ( PopNumber , LevelGrid , PortGrid , pheromone , ...     HeightData , starty , starth , endy , endh ); fitness = CacuFit ( path );                           %适应度计算 [ bestfitness , bestindex ]= min ( fitness );           %最佳适应度 bestpath = path ( bestindex ,:);                     %最佳路径 BestFitness =[ BestFitness ; bestfitness ];           %适应度值记录 l = 0 ; % Loop counter % Main loop while l < Max_iter     for i = 1 : size ( path , 1 )                 % Return back the search agents that go beyond the boundaries of the search space         Flag4ub = path ( i ,:) > ub ;         Flag4lb = path ( i ,:) < lb ;         path ( i ,:)= round (( path ( i ,:) .* ( ~ ( Flag4ub + Flag4lb ))) + ub .* Flag4ub + lb .* Flag4lb );                 % Calculate objective function for each search agent         fitness = CacuFit ( path ( i ,:));                 % Update Alpha, Beta, and Delta         if fitness < Alpha_score             Alpha_score = fitness ; % Update alpha             Alpha_pos = path ( i ,:);         end                 if fitness > Alpha_score && fitness < Beta_score             Beta_score = fitness ; % Update beta             Beta_pos = path ( i ,:);         end         end

5 仿真结果

6 参考文献

[1]段海滨, 张岱峰, 范彦铭,等. 从狼群智能到无人机集群协同决策[J]. 中国科学F辑, 2019, 049(001):112-118.

7 代码下载

天天Matlab

赞赏二维码 微信扫一扫赞赏作者 赞赏

已喜欢, 对作者说句悄悄话
最多40字,当前共

  人赞赏

1 / 3

长按二维码向我转账

赞赏二维码

受苹果公司新规定影响,微信 iOS 版的赞赏功能被关闭,可通过二维码转账支持公众号。

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