✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
⛄ 内容介绍
研究传染性公共卫生事件发生后疫区的应急物资供应问题,为避免传染,对中高风险疫区采用"无接触式"的无人机配送方式,低风险疫区采用卡车配送方式,在此基础上设计疫区应急物资供应的卡车-无人机动态协同配送模式.综合考虑疫区风险级别,无人机容量,飞行距离,卡车容量等因素,以应急物资总配送时间最短为目标,构建卡车-无人机动态协同配送路径规划模型,并设计一种自适应遗传算法求解.实验结果表明:本文方法能在非常短的时间内求解出符合决策者目标的卡车-无人机动态协同路径规划方案,有效缩短应急物资总配送时间,能为政府部门在重大传染性公共卫生事件下的应急物资配送提供决策参考.
⛄ 部分代码
% D2TSP_GA Truck and 2 drones Tream Traveling Salesmen Problem
%%
% Truck and two Drones Traveling Salesman Problem:
% (D2-TSP) To run default values, just press the run button!
%
% The idea is to use a truck and two drones in tandem to deliver
% small parcels to randomly distributed customers such that
% all stops are delivered to by a truck or a drone
% exactly once then return to starting location (depot). Both drones
% are constrained by range and capacity. Each drone must rendezvous
% back with the truck at a downtream stop to swap out drone battery.
% Each drone may visit 1 to 3 stops based on capacity before returning
% to the truck. The central idea is found in literature under the key
% word (last mile, drone delivery, drone TSP, two drone TSP).
%
% Algorithm highlights: Genetic Algorithm (GA). Finds a (near) optimal
% solution to the d2-TSP (D2TSP or d2TSP) by setting up a GA to search
% for the shortest timed route - least time needed for the in-tandem team
% to travel and deliver to all stops (i.e. UPS/FedEx) and then return to
% their starting locations-depots. For each operation launch-deliver-
% rendezvous, the max time of the truck or either drone is used to
% calculate the time for the route. The objective of the algorithm is to
% minimize total time for team, return the route for truck, 2 drones, and
% to denote where the operations take place.
%
% Summary:
% 1. Each truck drone team travels to a their own stops and then
% rendezvous at an operation start/end for recharging the drones.
% 2. Each stop is visited by a truck, a drone, or both (rendezvous op).
% 3. Drone are constrained by capacity and range and must return to
% truck at the end of range and to pick up another parcel to
% deliver.
% 4. Energy is also calculated as this is becoming a more interesting
% topic for drone deliveries.
% 5.
% Input:
% USERCONFIG (structure) with zero or more of the following fields:
% Input variables as a structure: example and description
% defaultConfig.nCities = 50;(integer) number of stops or deliveries
% defaultConfig.capacity = 3; (integer) for drone capacity (1,2,3)
% defaultConfig.range = 10;(real) drone range (10, 15, 20)
% defaultConfig.speed = 2; (integer)drone speed as factor of
% truck speed at 35km/hr.
% defaultConfig.energy = 5e4; (real) drone energy J/km
% defaultConfig.energyP = 5e4; (real) drone energy J/parcel-km
% defaultConfig.energyT = 8.08e6; (real) truck energy J/km
% defaultConfig.energyTP = 4.04e4; (real) truck J/parcel-km
% defaultConfig.cost = .04; (real) drone cost/km
% defaultConfig.costT = .70; (real) truck cost/km
% defaultConfig.xy = 10*rand(defaultConfig.nCities,2);
% randomly generated coordinates of stops
% defaultConfig.dmat = []; (real) distance matrix
% defaultConfig.popSize = 200; (integer) population size
% defaultConfig.numIter = 2.5e2; (integer) number of iterations
% defaultConfig.showProg = true; (boolean) show progress of route
% defaultConfig.showResult = true; (boolean) show results-output
% defaultConfig.showWaitbar = false; (boolean) show wait bar
% Input Notes:
% 1. Rather than passing in a structure containing these fields, any of
% these inputs can be passed in as parameter/value pairs in any order.
% 2. Field/parameter names are case insensitive.
%
% Output: The results are displayed in the command prompt upon completion.
% The the inputs above as well as note below on outputs for
% for descriptions on each field.
% RESULTSTRUCT (structure) with comprised of various fields:
% 'xy', xy, ...
% 'dmat', dmat, ...
% 'popSize', popSize, ...
% 'numIter', numIter, ...
% 'showProg', showProg, ...
% 'showResult', showResult, ...
% 'showWaitbar', showWaitbar, ...
% 'optRoute', optRoute, ...
% 'opOps', opOps, ...
% 'opTrk', opTrk, ...
% 'opDrn', opDrn, ...
% 'opDrn2', opDrn2, ...
% 'nCities', nCities, ...
% 'cap', cap, ...
% 'range', range, ...
% 'speed', speed, ...
% 'cost', cost, ...
% 'costT', costT, ...
% 'energy', energy, ...
% 'energyT', energyT, ...
% 'energyP', energyP, ...
% 'energyTP', energyTP, ...
% 'minEnergy', minEnergy, ...
% 'minEnergyP', minEnergyP, ...
% 'minCost', minCost, ...
% 'minTime', minTime, ...
% 'minDist', minDist);
%
% Route/Operations Details:
% There is one truck and two drones in this scenario (d2TSP).
% Therefore a possible truck rout rte = [5 6 9 1 4 2 8 10 3 7]
% possible capacity(2) drone rout of 2 rte2 = [5 10 11 9 12 14 8 15 7]
% possible operations ops = [5 9 8 7]
% These are found by taking the binary routes (trk, drn, ops) and
% multiplying by the opt route (working generic route)
% Once multiled, remove zeros and these denote the truck route
% solution, drone route solution as well as the rendezvous operations
% where the truck swaps out a battery for the drone. As such:
% . Truck 1: travels stops 5, 6, 9, 1, 4, 8, 10, 3, 7 then 5
% . Drone 1: travels from stop 5, 10, 11, 9, 12, 14, 8, 15, 7,5
% . Operations: team rendezvous at 5, 9, 8, 7
%
end % end function
⛄ 运行结果
⛄ 参考文献
[1]刘长石, 吴张, 周愉峰,等. 疫区应急物资供应的卡车-无人机动态协同配送路径优化.
[2]邓永蕤. 时变网络下带时间窗的卡车和无人机协同配送路径优化研究[D]. 西南交通大学.
[3]李闯. 农村地区货车和多无人机协同配送路径规划研究[D]. 大连海事大学.