【编队】基于遗传算法实现无人机编队为位置优化附matlab代码
【编队】基于遗传算法实现无人机编队为位置优化附matlab代码
TT_Matlab
博主简介:擅长智能优化算法、神经网络预测、信号处理、元胞自动机、图像处理、路径规划、无人机等多种领域的Matlab仿真,完整matlab代码或者程序定制加qq1575304183。
✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
个人主页: Matlab科研工作室
个人信条:格物致知。
更多Matlab仿真内容点击
智能优化算法 神经网络预测 雷达通信 无线传感器 电力系统
信号处理 图像处理 路径规划 元胞自动机 无人机
⛄ 内容介绍
UAV swarms have numerous applications in our modern world. They can facilitate mapping, observing, and overseeing large areas with ease. It is necessary for these agents to autonomously navigate potentially dangerous terrain and airspace in order to log information about areas. In this project we simulate the motion of a swarm of drones, and their interaction with obstacles, and targets.
The goal of this project is to optimize this simulation using a Genetic Algorithm to maximize the number of targets mapped, minimize the number of crashed drones, and minimize the amount of time used in the simulation. To do this we will use 15 design parameters to determine the dynamics and kinematics of each drone, using Forward Euler time discretization to update drone positions.
A Genetic Algorithm will be used to train this swarm of drones by generating random strings of design parameters, and breeding new strings to fifind the optimal string for this simulation. In this paper, I will present relevant background information, and equations to describe the simulation. I will also describe the process by which I go about optimizing the Genetic Algorithm. Finally, I present the outcome of the simulation and Genetic Algorithm, and discuss the relevance of my results.
⛄ 部分代码
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function myProgressBar(tock, t, tf, m)
% Provides a status update on a calculation, printed to the command window.
% avoids the issues associated with the GUI-based equilvalent functions.
%
% Inputs:
% tock -- total run time so far, seconds
% t -- cycles, simulation time, etc completed
% tf -- total cycles, etc required for process
% m -- optional message input, empty by default
% Outputs:
% no variables, prints information to the command window in the format:
% "#######-----------" + "m" + "Time remaining: " + "HH:MM:SS"
if nargin < 4
m = ’’;
end
rem = max(tock*(tf/t - 1), 0);
clock = sec2Clock(rem);
totchar = 20;
fprintf(repeatStr("#", floor(t/tf*totchar)) + repeatStr("-", totchar - floor(t/tf*totchar)) ...
+ " " + m + " Time remaining: " + clock + " ");
end
function out = sec2Clock(s)
% returns a string of characters that represents a number of seconds in
% format HH:MM:SS. Can include arbitrarily many hour digits to account for
% large times. Rounded down to nearest number of seconds.
remh = floor(s / 3600); s = s - 3600*remh; remm = floor(s / 60); s = s - 60*remm; rems = floor(s);
out = padStr(num2str(remh), "0", 2) + ":" + padStr(num2str(remm), "0", 2) ...
+ ":" + padStr(num2str(rems), "0", 2);
end
function out = padStr(st, pad, minlength)
% returns string st plus some number of pad characters such that the total
% string length is as least minlength. Puts the padding on the left side.
out = st;
while (strlength(out) < minlength) out = pad + out; end
end
function out = repeatStr(st, n)
% returns a given string st repeated n times
out = ""; for i = 1:n out = out + st; end
end
⛄ 运行结果
The simulation was successfully optimized using a Genetic Algorithm. The dynamics, and kinematic equations of 15 UAVs were used to simulate the movements of these drones. Each drone was affected by a repulsive, and an attractive force from each other member, target, and obstacle. These equations utilized 15 design parameters that were optimized by a Genetic Algorithm. Random strings of design parameters were created at the beginning, passed into the simulator, and the resulting success of the strings was evaluated. The strings were then ranked, and the top strings were mated with each other, resulting in child strings. The next generation was fifilled out with more randomly generated strings, and the process was repeated for 100 generations. The GA resulted in a fifinal cost of 25.3333. Additional optimizations for T*, and prevention of inbreeding could signifificantly decrease the cost, and should be implemented in future work on this, and other projects.
⛄ 参考文献
⛳️ 代码获取关注我
❤️部分理论引用网络文献,若有侵权联系博主删除
❤️ 关注我领取海量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
