%% =========================================================================== % Copyright (C): % 2005-2009 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % Project : BANG, FTW % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % % CVS: $Id: getScenario.m 556 2004-12-30 15:37:50Z tono $ %% =========================================================================== % Change History % 2005-04-21 (ToNo) Created based on earlier SpM evaluation code %% =========================================================================== %% ======================================================================== % Find the position of the new system nspos = length(ntt); if ~strcmp(ntt{nspos}{1},'NewSys') error('OPS no NewSys (or in wrong position) in ntt'); end; %% ======================================================================== % Find the reach of all NewSystems if donsreach [nomixes, nomod] = size(nosystems); for mixture = 2:nomixes % Note, do not try the reference scenario % Set up the correct nymber of modems for each mixture nosys = nosystems(mixture,:); for mix = 1: nomod ntt{mix}{2} = nosys(mix); end; % Make all ADSL and VDSL (av) systems movable ex.param.modemlist=ntt{avsys(1)}{1}; ntt{avsys(1)}{3} =-1; for mtype = avsys(2:end) ex.param.modemlist = str2mat(ex.param.modemlist,ntt{mtype}{1}); ntt{mtype}{3} =-1; end; nsreaches=10000*ones(length(NewSystems)); for nsix = 1:length(NewSystems) tsys = NewSystems{nsix}; ex.param.xDSLlist{1}.used = tsys; ex.param.modemlist = ex.param.xDSLlist{1}.name; tfplan = getList(ex.tfplist,tsys); if tfplan.fixBitrate.active % Set up to test the reach of margin limited systems ex.ms.ntt = ntt; ex.ms.resrow = 1; ex.ms.cable='TP100'; %oset=optimset('TolX',1e-2,'disp','iter'); oset=optimset('TolX',1e-2); [reach,fval,exitflag,output]=fzero(@marginEval,[250,8000],oset); cnt = output.funcCount; else % Set up to test the reach of rate limited systems if length(strfind(tsys,'ADSL')>0) ds_target = 512e3/1e6; % ADSL bitrates [Mbit/s] us_target = 64e3/1e6; else ds_target = 6.4; % VDSL bitrates [Mbit/s] us_target = 6.4; end; target.ds=ds_target; target.us=us_target; resposition=1; [reach,cnt]=rateSearch(resposition,target,ntt); end fprintf('%25s reach was %.0f m\n',tsys,reach); % fprintf('.') totalcnt = totalcnt+cnt; noiters = noiters+1; nsreaches(nsix)=reach; end; % for nsix = 1:length(NewSystems) end % mixture = 2:nomixes if 0, % open doc/Tests/MPM_plots2/MPMeSDSLMix1.fig hold on plot(nsreaches(1:length(bratesE16),1),bratesE16/1e3,'k-*'); plot(nsreaches(length(bratesE16)+1:end,1),bratesE32/1e3,'m-*'); end; end; %if donsreach %% ======================================================================== % Get data for ADSL and VDSL plots if length(avsys)>0 clear mixrates; [nomixes, nomod] = size(nosystems); for mixture = 1:nomixes % Set up the correct nymber of modems for each mixture nosys = nosystems(mixture,:); for mix = 1: nomod ntt{mix}{2} = nosys(mix); end; % Make all ADSL and VDSL (av) systems movable avmodemlist=ntt{avsys(1)}{1}; ntt{avsys(1)}{3} =-1; for mtype = avsys(2:end) avmodemlist = str2mat(avmodemlist,ntt{mtype}{1}); ntt{mtype}{3} =-1; end; ex.param.modemlist = avmodemlist; if mixture == 1 brates = []; % Evaluate bitrates for various loop lengths for looplen = [100:200:1500 1900:400:6100], if looplen>=1500 ntt{vdslix}{3}=1500; % Stop VDSL at 1500m end; ex.tt=TTsetup(ntt,looplen); result=evalExperiment; [bitrate_US, bitrate_DS] = calcXDSLresult(ex,result); brates = [brates; looplen, bitrate_US, bitrate_DS]; totalcnt = totalcnt+1; fprintf('.'); end; noiters = noiters+1; mixrates{mixture}{1} = brates; fprintf('\n'); else for nsix = 1:length(NewSystems) ntt{vdslix}{3}=-1; brates=[]; tsys = NewSystems{nsix}; ex.param.xDSLlist{1}.used = tsys; % Evaluate bitrates for various loop lengths for looplen = [100:200:1500 1900:400:6100], if looplen>=1500 ntt{vdslix}{3}=1500; % Stop VDSL at 1500m end; ex.tt=TTsetup(ntt,looplen); result=evalExperiment; [bitrate_US, bitrate_DS] = calcXDSLresult(ex,result); brates = [brates; looplen, bitrate_US, bitrate_DS]; totalcnt = totalcnt+1; fprintf('.'); end; noiters = noiters+1; mixrates{mixture}{nsix} = brates; fprintf('\n'); end % nsix = 1:length(NewSystems) end % if mixture == 1 end % mixture = 1:nomixes %% ======================================================================== % Make plots if plotit, % Plot resulting bitrate curves lav=length(avsys); for aix = 1:lav figure; h=[];mixlegend = {}; for mixid = 1:nomixes for runix = 1:length(mixrates{mixid}) brates=mixrates{mixid}{runix}; if mixid == 1 mixname = 'Reference Mix'; mixcolor = {'b','r'}; hu = plot(brates(:,1),... brates(:,1+aix),mixcolor{1}); set(hu,'LineWidth',3); hold on; hd = plot(brates(:,1),... brates(:,1+lav+aix),mixcolor{2}); set(hd,'LineWidth',3); h = [h, hu, hd]; mixlegend = {mixlegend{:}, ... sprintf('US %s',mixname), ... sprintf('DS %s',mixname)}; else mixname = sprintf('Mix-%d %s',... mixid-1,NewSystems{runix}); mcolor={'g','m','k','c','b','r'}; mcix = mod(runix-1,length(mcolor))+1; mixcolor = {[mcolor{mcix} '-x'] ... [mcolor{mcix} '-o']}; hu = plot(brates(:,1),... brates(:,1+aix),mixcolor{1}); hd = plot(brates(:,1),... brates(:,1+lav+aix),mixcolor{2}); h = [h, hd]; mixlegend = {mixlegend{:}, sprintf('%s',mixname)}; if donsreach % Plot system reach nsr = nsreaches(runix,1); dsbr = interpolate(brates(:,1),... brates(:,1+lav+aix),nsr); plot(nsr,dsbr, 'k*') end; end end; % runix = 1:length(mixrates{mixid}) end; % mixid = 1:nomixes legend(h,mixlegend); title(sprintf('Scenario %s - System %s',... Scenario, result{aix}.Modem.Name)); grid on if avsys(aix)==vdslix axis([0 1500 0 35]); legend(h,mixlegend,3); end; end; % for aix %% ======================================================================== % Get data for ADL-64 for nsix = length(NewSystems) tsys = NewSystems{nsix}; % Only test new ADSL systems this way if length(strfind(tsys,'ADSL'))>0 nosys = nosystems(2,:); % mixture = 2; for mix = 1: nomod ntt{mix}{2} = nosys(mix); end; % Make all ADSL and VDSL (av) systems movable ntt{avsys(1)}{3} =-1; for mtype = avsys(2:end) ntt{mtype}{3} =-1; end; ntt{nspos}{3} =-1; ex.param.modemlist = ex.param.xDSLlist{1}.name; ex.param.xDSLlist{1}.used = tsys; brates = []; % Evaluate bitrates for various loop lengths for looplen = [100:200:1500 1900:400:6100], if looplen>=1500 ntt{vdslix}{3}=1500; % Stop VDSL at 1500m end; ex.tt=TTsetup(ntt,looplen); result=evalExperiment; [bitrate_US, bitrate_DS] = calcXDSLresult(ex,result); brates = [brates; looplen, bitrate_US, bitrate_DS]; totalcnt = totalcnt+1; fprintf('.'); end; noiters = noiters+1; fprintf('\n'); figure; h=[];mixlegend={}; hnus = plot(brates(:,1),brates(:,2),'b^-'); hold on hnds = plot(brates(:,1),brates(:,3),'bv-'); h = [h, hnds]; mixlegend = {mixlegend{:}, sprintf('%s',tsys)}; refrates=mixrates{1}{1}; newrates=mixrates{2}{nsix}; for aix = 1:lav mcolor={'m','k','c','g','r'}; mcix = mod(aix-1,length(mcolor))+1; if length(strfind(ntt{avsys(aix)}{1},'ADSL'))>0 mixcolor = {[mcolor{mcix} '-x'] ... [mcolor{mcix} '-o']}; hus = plot(refrates(:,1),... refrates(:,aix+1),mixcolor{1}); hds = plot(refrates(:,1),... refrates(:,aix+1+lav),mixcolor{2}); h = [h, hds]; mixlegend = {mixlegend{:}, ... sprintf('Ref %s',ntt{avsys(aix)}{1})}; mixcolor = {[mcolor{mcix} '-^'] ... [mcolor{mcix} '-v']}; hus = plot(newrates(:,1),... newrates(:,aix+1),mixcolor{1}); hds = plot(newrates(:,1),... newrates(:,aix+1+lav),mixcolor{2}); h = [h, hds]; mixlegend = {mixlegend{:}, ... sprintf('Mix %s',ntt{avsys(aix)}{1})}; end; end; % aix = 1:lav legend(h,mixlegend); grid on; title(sprintf('Scenario %s - New vs. old ADSL', Scenario)); end; % if ADSL end; % for all New Systems drawnow; end; % if plotit end; % if length(avsys)>0