Code covered by the BSD License  

Highlights from
CTMSIM - an interactive freeway traffic macrosimulator

image thumbnail
from CTMSIM - an interactive freeway traffic macrosimulator by Alex Kurzhanskiy
Freeway traffic simulation based on Asymmetric Cell Transmission Model

get_ramp_lists(celldata)
function [orls, frls] = get_ramp_lists(celldata)
% GET_RAMP_LISTS - populate to text buffers with on-ramp and off-ramp names.
%
% Call:   [orls, frls] = get_ramp_lists(celldata)
%
% Parameter:   celldata - array of freeway cell structures.
%
% Returns:
%          orls - list of on-ramp names;
%          frls - list of off-ramp names.
%          If a cell does not have an on- (off-) ramp, the on- (off-) ramp name
%          is substituted by 'Cell #' string. 
%
% Last modified:   07/30/2006.

%
% Alex Kurzhanskiy   <akurzhan@eecs.berkeley.edu>
%

orls = 'In-flow';
frls = [];

N    = size(celldata, 2);  % number of cells

for i = 1:N
  orn = celldata(i).ORname;
  if isempty(orn)
    orn = ['Cell ' num2str(i)];
  end
  frn = celldata(i).FRname;
  if isempty(frn)
    frn = ['Cell ' num2str(i)];
  end
  orls = strvcat(orls, orn);
  frls = strvcat(frls, frn);
end

orls = strvcat(orls, 'Out-flow');

return;

Contact us at files@mathworks.com