% =========================================================================== % Copyright (C): % 2003-2009 by Forschungszentrum Telekommunikation Wien, Austria; % All rights reserved. % Description : This routine % % Project : BANG, FTW % Author(s) : Tomas Nordstrom (Tomas.Nordstrom@FTW.at) % % Reference: % % CVS: $Id: SpM.m,v 1.2 2005/01/04 10:25:12 tono Exp $ %% =========================================================================== %% =========================================================================== % Change History % 2003-11-11 (ToNo) Created % 2004-01-14 (ToNo) Simulation of reference scenarios completed % 2005-01-14 (ToNo) Split up into smaller parts % 2008-10-09 (ToNo) Made fzero compatible with octave forge %% =========================================================================== global ex; %% ======================================================================== % % needs: % ntt -- Describes the scenario % Each row is defining a technology, the number of % modems, and a distance. % For example: {'ETSI-ADSL-FDDoverPOTS', 75, -1} (where % '-1' signifcates default distance) % refsys -- A vector indicating which rows in ntt containts % reference systems % avsys -- A vector indicating ADSL or VDSL systems % nosystems -- A matrix where each row gives the number of modems % to be used for a technology, typically there are two rows, one % indicating without the new systems and one including it. % vcc -- A vector indicating which modems use virtual % collocation should be used % vccno -- A matrix where each row indicates how many % collocated modems there will be for each "zone" % progressbar -- Flag to indicate if we should do progress printing % totalcnt % noiters % Results are put in reflen % Get current distances of reference systems reflen=[]; for ix=1:length(ntt) reflen(ix)=ntt{ix}{3}; end; movable=reflen(refsys)<0; while any(movable) reaches=10000*ones(size(reflen)); for ypos = refsys(movable) tsys = ntt{ypos}{1}; ex.param.modemlist = str2mat(tsys); 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); if onMatlab [reach,fval,exitflag,output]=fzero(@marginEval,[250,8000],oset); cnt = output.funcCount; else [reach,fval,exitflag]=fzero(@marginEval,[250,8000],oset); cnt = 6; % Not available end; else % Set up to test the reach of rate limited systems if ~isempty(findstr(tsys,'ADSL')) 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 if progressbar %fprintf('%25s reach was %.0f m\n',tsys,reach); fprintf('.'); if ~onMatlab fflush(stdout); end end; totalcnt = totalcnt+cnt; noiters = noiters+1; reaches(ypos)=reach; end; % for ypos = refsys % Now we have the reach for the modem that gave up first [shortest,six] = min(reaches(refsys)); % Place that modem at its reach reflen(refsys(six))=shortest; ntt{refsys(six)}{3}=shortest; if progressbar fprintf('\n%25s fixed at %.0f m\n',... ntt{refsys(six)}{1},ntt{refsys(six)}{3}); end; movable=reflen(refsys)<0; % Any more movable systems? % Support VCC if asked for novcc= length(vcc); if novcc>0 % Force HDSL to be collocated if ntt{refsys(six)}{1}(1:4) == 'HDSL' ntt{refsys(six)}{3}=-1; % Now collocate it refsys(six)=0; % Remove it from refsys refsys=refsys(find(refsys)); end; % Set up correct no of SDSL vccix = novcc-sum(reflen(vcc)<0)+1; vccix = min(vccix,novcc); for tempix = 1:novcc ntt{vcc(tempix)}{2} = vccno(vccix,tempix); end; end; % Fix the colloction of HDSL in HPM if strcmp(Scenario,'HPM') == 1 if strcmp(ntt{refsys(six)}{1}, 'HDSL-CAP-2p') == 1 ntt{refsys(six)}{3}=reflen(refsys(six)-1); % Set it to HDSL-2B1Q-2p end; end; end % while movable