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

📄 findoptt.m

📁 这是一个超宽带的源码
💻 M
字号:
%% function optt = findoptt(L,C,pmax,rP,a,w,maxw)%% Arguments:% L - links in the network% C - coordinates of nodes% pmax - max. transmission power% rP - see rndtopo2d% a - fading coefficient (a<-2)%% Output:% optt(i) - optimal blocking distance around destination of L(i), %           i.e. radius of the circle in which there should be no active nodes%           when L(i) is active.%%% Description:% We try to estimate the optimal blocking distance for the source of each link. % For every node we start with a candidate distance t. We then estimate a number of slots N needed% for the network as a number of link sources in that circle. We also estimate the interference% generated by the rest of the network as I = 2*pi* lambda * int_t^infty x^-alpha, that is% I = 2*pi*lambda * s^{-alpha+1} / (alpha-1). We then try different possible t until we maximize% N / (1+I) which is our mimic of the rate objective function.%% ADDENDUM: New and improved heuristics. Assume t. Count the number of link sources in the blocking % region (it-1). Count the interference of the nodes outside (I). Divide I by (it-1) since only% every (it-1) node is going to send at a time. Add white noise (1) to I. Minimize (it-1)*I since% rate is inversly proportional to this.%%function optt = findoptt(L,C,pmax,rP,a,w,maxw,rat)if nargin < 8	rat = 0;endif nargin < 7	maxw = 1;endif nargin < 6	w = ones(size(L,1),1);endeps = 1e-5;nl = size(L,1);nn = size(C,1);optt = zeros(1,nl);for i=1:nl    an = [1:L(i,1)-1,L(i,1)+1:nn];	dd = dist(an, L(i,2)+zeros(size(an)), C);    [dd,indd] = sort(dd);	rPi = rP(indd);    it = 2;    mmin = Inf;    ch = 1;    while ch & it <= nn-1        ch = 0;        t = dd(it);                % calculate interference of the other nodes        % this is not possible in a real network!                I = 0;        for j=it+1:nn-1            I = I + rPi(j)*dd(j)^a;        end        I = I / (it-1);                I = 1 + pmax * I;                        % veoma los estimator na bazi point processa (al zapravo iz moje glave)        %I = 2*pi/nn;        %I = I * t^(a+1) / (-a-1);                if mmin > (it-1)*I            mmin = (it-1)*I;            ch = 1;        end            it = it+1;    end    if it == nn        optt(i) = dd(nn-1) + eps;    else        optt(i) = dd(it-2) + eps;    end        	optt(i) = optt(i) * (1 + rat * w(i)/maxw);    end

⌨️ 快捷键说明

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