【无人机路径规划】基于强化学习的多无人机移动边缘计算与路径规划附matlab代码

该文探讨了利用无人机作为移动服务器在移动边缘计算中的应用。通过MATLAB仿真,研究了如何根据终端用户位置动态规划无人机路径以保证服务质量。文中包含了一段关于路径规划的代码示例,该代码涉及危险矩阵和最小值搜索算法来更新路径。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

​✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信       无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机 

⛄ 内容介绍

空中无人机(UAVs)作为网络处理器在移动网络中长期使用,但它们现在被用作移动边缘计算(MEC)中的移动服务器。由于它们的灵活性、便携性、强大的视线通信联系和低成本、可改变的使用,它们在研究和商业应用中变得更加流行。更广泛的民用服务现在可能被这些重要的特征所支持,包括运输和工业监测和农业,以及森林和有线服务。本项目研究了基于无人飞行器的移动计算网络,无人飞行器(UAV)进行计算,移动终端用户向其提供计算。为了确保每个终端用户的服务质量(QoS),无人飞行器根据移动终端用户的位置动态选择其路线。

⛄ 部分代码

function PATH = planning(i,initial_pos,E_matrix)

global TARGET;

global TU_demand_matrix;

global UAVnum;

global G;

global N;

global EPISOD_SUM;

global K;

global M;

G_ori=G; % store G

% PATH= planning(G{i},round(UAV_pos(i,:)*N),TARGET,E_matrix,TU,N,EPISOD_SUM,K,M);

%% initialize G with all elements are N^2 and target 0

% add the following lines then G will be refreshed in each planning

for j=1:UAVnum

    G{j}=ones(N,N)*N^2;

    G{j}(TARGET(1),TARGET(2))=0;

end

%% update G matrix

node=TARGET;

for t=1:EPISOD_SUM  % while in max iteration num

    % invoke dangerMatrx.m to return a weight matrix A

    A=dangerMatrix(node,E_matrix);

    G{i}=min(G{i},G{i}(node(1),node(2))+A);  % a reward matrix to update G to find most minimum element

    node=randi(N,1,2);                       %randomly find 1*2 int matrix range(0,N)

end

% every element in G is the minimum value to that position

%% calculate PATH by W

step=1;

s=initial_pos;

PATH=[];

G_tmp=G{i};

while(~isequal(s,TARGET) && step<N*2)  % continue to planning as long as UAV hasn't arrived at target or step<2N

    step=step+1;

    %% revised

    cost_add=dangerMatrix(s,E_matrix);

    W2=G_tmp+cost_add;

    [row_index,column_index]=find(W2==min(min(W2))); % find min element in W2

    % there might be 1+ minium, so use row_index(1)

    row_index=row_index(1);

    column_index=column_index(1);

    

    s=[row_index,column_index];

    G_tmp(row_index,column_index)=N^2;

    

    % prevent deadlock in PATH

    if(~isempty(PATH)&&ismember(s,PATH,'rows'))

        continue;

    else

        PATH=cat(1,PATH,s);

    end

    %% original

    %         A2=dangerMatrix(s,E_matrix);

    %         W2=G{i}+A2;

    %         W2(s(1),s(2))=abs(min(min(W2))*1.5); %make sure s value is not minimum in W2

    %         [a,b]=min(W2);                       %find min element in W2 and assign the column and row to s(1) and s(2)

    %         [~,d]=min(a);

    %         s(1)=b(d);

    %         s(2)=d;

    %         PATH=cat(1,PATH,s);                %add new s position to TRACE

    

end

G=G_ori; % restore G

end

⛄ 运行结果

⛄ 参考文献

[1] Wang L ,  Wang K ,  Pan C , et al. Multi-Agent Deep Reinforcement Learning-Based Trajectory Planning for Multi-UAV Assisted Mobile Edge Computing[J]. IEEE, 2021(1).

⛳️ 完整代码

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

❤️ 关注我领取海量matlab电子书和数学建模资料

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

matlab科研助手

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值