⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 combinerte.m

📁 物流分析工具包。Facility location: Continuous minisum facility location, alternate location-allocation (ALA)
💻 M
字号:
function [cmbrte,st] = combinerte(out)
%COMBINERTE Combine non-overlapping routes.
% [cmbrte,st] = combinerte(out)
%   out = m-element struct array of timing output from RTETC
%cmbrte = combine non-overlapping routes, where 
%         cmbrte{i} = [j k] represents the i-th combined route consisting
%         of route j followed by route k
%
% Uses greedy combination heuristic
%
% Example:
% [TC,out] = rteTC(rte,C,cap,twin)
% [cmbrte,st] = combinerte(out);
% [TC,out] = rteTC(cmbrte,C,cap,twin);  % Re-calc "out"

% Copyright (c) 1994-2006 by Michael G. Kay
% Matlog Version 9 13-Jan-2006 (http://www.ie.ncsu.edu/kay/matlog)

% Input Error Checking ****************************************************
% End (Input Error Checking) **********************************************

for i = 1:length(out)
   ES(i) = out(i).EarlySF(1);
   LS(i) = out(i).LateSF(1);
   EF(i) = out(i).EarlySF(2);
end

i = argsort(LS);
st = ES;

n = 0;
while ~isempty(i)
   n = n + 1;
   i1 = i(1); i(1) = [];
   cmbrte{n} = i1;
   
   done = 0;
   while ~done && ~isempty(i)
      d = LS(i) - EF(i1);
      ij = i(d > 0);
      if isempty(ij)
         done = 1;
      else
         ij = ij(argmin(d(d > 0)));
         cmbrte{n}(end + 1) = ij;
         st(ij) = max(EF(i1),ES(ij));
         EF(i1) = st(ij) + EF(ij) - ES(ij);
         i(i == ij) = [];
      end
   end
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -