1 Star 2 Fork 0

xuelanghanbao / 汽车制造涂装-总装缓存调序区调度优化建模

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
m08_moveCar.m 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
function R = m08_moveCar(R,t)
if t<10 || t+8>size(R,2)
return;
end
for i = 1:size(R,1)
area = R(i,t-1);
lane = area;
c10 = 0;
while lane>10
lane = floor(lane/10);
c10 = c10+1;
end
place = area-10^c10*lane;
cantmove = 0;
if area<10 || (lane==7&&place==10) || (lane~=7&&place==1)
continue;
elseif lane==7
strPos = str2double([num2str(lane) num2str(place+1)]);
for j=1:size(R,1)
if R(j,t)==strPos
cantmove = 1;
break;
end
end
if cantmove ==1
continue;
end
if R(i,t)~=R(i,t-8)
continue;
end
R(i,t+10:end) = strPos;
else
strPos = str2double([num2str(lane) num2str(place-1)]);
for j=1:size(R,1)
if R(j,t)==strPos
cantmove = 1;
break;
end
end
if cantmove ==1
continue;
end
if R(i,t-1)~=R(i,t-9) || R(i,t-1)~=R(i,t+8)
continue;
end
R(i,t+10:end) = strPos;
end
end
end
Matlab
1
https://gitee.com/xuelanghanbao/PBS-Optimization-Modeling.git
git@gitee.com:xuelanghanbao/PBS-Optimization-Modeling.git
xuelanghanbao
PBS-Optimization-Modeling
汽车制造涂装-总装缓存调序区调度优化建模
master

搜索帮助