1 简介
在考虑汽车零部件包装箱长、宽、高等三维尺寸的约束下,以配送中心为原点,分派多辆同一规格的货车到n个供应商处取货,最后回到配送中心。本章所构建的三维装载约束下的汽车零部件循环取货路径优化模型要解决的问题是确定循环取货路径,要求充分考虑汽车零部件在货车车厢中的三维装载位置,确保每个供应商处的零部件均能成功装载,尽可能使车辆装载率最大,且所有车辆的总行驶路径最短。
基于上述分析,本文所研究的循环取货优化问题可做如下假设:
假设条件:
(1) 一个配送中心与多个供应商,且车辆从配送中心出发,最后均回到配送中心;
(2) 每辆货车车厢规格(即车厢长、宽、高,载重质量等)均相同;
(3) 每辆货车匀速行驶,且行驶速度已知;不存在交通堵塞情况;
(4) 配送中心与各零部件供应商以及各供应商之间的距离已知;
(5) 各供应商处提供的零部件均由长方体箱包装,且各长方体箱的尺寸、数量、重量等参数已知;
(6) 每个供应商提供的零部件总体积、总重量均小于每辆车的容积与载重质量;每个供应商只由一辆车完成服务,且只服务一次;
(7) 每条线路上的货物总重量、总体积不得超过货车载重质量及容积;
(8) 考虑汽车零部件供应的准时性,每辆货车必须在规定时间以内返回配送中心;
(9) 零部件(指长方体包装箱,下同)必须在车厢内部,不得超出车厢车门;
(10) 零部件的边总是与车厢的边平行或者垂直、高度方向与车厢高度方向平行,且不得倒置;
(11) 货物的重心即为几何中心。
参数及变量符号说明:
2 部分代码
load('coordinate_data.mat');
load('goods_data.mat');
%distribution_center
center.x=25;
center.y=25;
%suppliers count
num_of_node=20;
coordinate_data=coordinate_data(3:end,:);
coordinate_data=cell2mat(coordinate_data);
goods_data=goods_data(2:end-1,:);
%goods_data=cell2mat(goods_data);
%data of total
total=struct('volume',0,'weight',0);
%struct of distribution center and goods
supplier_struct=...
struct('supplier_number',[],'x',[],'y',[],...
'volume_in_total',0,'weight_in_total',0,...
'goods',...
struct('number',[],'count',[],...
'length',[],'width',[],'height',[],...
'volume_for_each',[],'weight_for_each',[],...
'volume_in_total',[],'weight_in_total',[]));
supplier_struct(1:20)=...
struct('supplier_number',[],'x',[],'y',[],...
'volume_in_total',0,'weight_in_total',0,...
'goods',...
struct('number',[],'count',[],...
'length',[],'width',[],'height',[],...
'volume_for_each',[],'weight_for_each',[],...
'volume_in_total',[],'weight_in_total',[]));
%supplier's goods index
goods_index=0;
%circulate
[goods_data_size1,~]=size(goods_data);
for index=1:goods_data_size1
%non zero
if goods_data{index,1}~=0
%temp number
temp_num=goods_data{index,1};
supplier_struct(temp_num).supplier_number=...
temp_num;
%location
supplier_struct(temp_num).x=...
coordinate_data(temp_num,2);
supplier_struct(temp_num).y=...
coordinate_data(temp_num,3);
%goods index reset for this supplier
goods_index=0;
else
goods_data{index,1}=temp_num;
end
%goods index++
goods_index=goods_index+1;
%number of this goods
supplier_struct(temp_num).goods(goods_index).number=...
goods_data{index,2};
%length of this goods
supplier_struct(temp_num).goods(goods_index).length=...
goods_data{index,3}/1000;
%width of this goods
supplier_struct(temp_num).goods(goods_index).width=...
goods_data{index,4}/1000;
%height of this goods
supplier_struct(temp_num).goods(goods_index).height=...
goods_data{index,5}/1000;
%count of this goods
supplier_struct(temp_num).goods(goods_index).count=...
goods_data{index,6};
%volume of this goods
supplier_struct(temp_num).goods(goods_index).volume_for_each=...
supplier_struct(temp_num).goods(goods_index).length*...
supplier_struct(temp_num).goods(goods_index).width*...
supplier_struct(temp_num).goods(goods_index).height;
%weight of this goods
supplier_struct(temp_num).goods(goods_index).weight_for_each=...
goods_data{index,8}/...
supplier_struct(temp_num).goods(goods_index).count;
%volume of this goods in total
supplier_struct(temp_num).goods(goods_index).volume_in_total=...
supplier_struct(temp_num).goods(goods_index).volume_for_each*...
supplier_struct(temp_num).goods(goods_index).count;
%weight of this goods in total
supplier_struct(temp_num).goods(goods_index).weight_in_total=...
goods_data{index,8};
%accumulate
supplier_struct(...
goods_data{index,1}).volume_in_total=...
supplier_struct(...
goods_data{index,1}).volume_in_total+...
goods_data{index,7};
supplier_struct(...
goods_data{index,1}).weight_in_total=...
supplier_struct(...
goods_data{index,1}).weight_in_total+...
goods_data{index,8};
end
%accumulate total figure
for supplier_index=1:num_of_node
total.volume=total.volume+...
supplier_struct(supplier_index).volume_in_total;
total.weight=total.weight+...
supplier_struct(supplier_index).weight_in_total;
end
clear index temp_num goods_index supplier_index;
clear goods_data_size1 goods_data_size2;
goods_data=cell2mat(goods_data);
%recovery
original_data_struct=...
struct('coordinate_data',coordinate_data,...
'goods_data',goods_data);
clear coordinate_data goods_data;