function dmax = getMaxVDSLlength(topology,traffic) %% =========================================================================== % getMaxVDSLlength(topology,traffic) - Get the maximum VDSL modem length % % Parameter: topology The toplogy % Parameter: traffic The traffic pattern % Returns: dmax The maximum distance for a VDSL modem % % Example(s): % % Algorithmic details % % Reference: % FTW's xDSLsimu manual %% =========================================================================== %% =========================================================================== % Copyright (C): % 1998-2000 by Telia Research AB, Lulea, Sweden; % 2001-2009 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % Project : FTW's xDSLsimu % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % : Daniel Bengtsson (Daniel.J.Bengtsson@Telia.se) % % CVS: $Id: getMaxVDSLlength.m 752 2009-01-02 13:03:52Z tono $ %% =========================================================================== % Change History % 1999-01-18 (DaB) Created to fix PBO ref_len bug % 1999-01-19 (ToNo) Fixed a misscalculation of traffic_routes % 1999-02-04 (DaB) Fixed bug when no VDSL modem % 1999-03-09 (DaB) Rewritten % 2002-07-23 (Peka) Octave port % 2003-11-03 (ToNo) Lists now use cell arrays for both Octave and Matlab %% =========================================================================== totlen(1)=0; nodes=size(topology,2); for b=2:nodes, x=topology{b}; totlen(b)=totlen(b-1)+x{1}; end; traffic_routes=length(traffic(:,1)); dmax=0; for a=1:traffic_routes, y=traffic{a}; if strncmp(y{3},'VDSL',4), d=totlen(y{2})-totlen(y{1}); else d=0; end; dmax=max(d,dmax); end;