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

📄 bandr_jit.m

📁 good for who wants it
💻 M
字号:
function varargout = bandr_jit(h, eventdata, handles, varargin)
% trgraph
global C1 C2 C3 C4 C6 C9 C10 NET AKTWEZ STARTWEZ HIST DC BANDI fig DELAY

thandles=guihandles(fig);
DELAY=1;
DC=1;
if AKTWEZ~=STARTWEZ
    NET=0; % whole network
    czyscosie;
    HIST=3; % ON if CHECK(2)==0
    x={'throughput', BANDI};
    [czy, opis]=czyopis(x, h, eventdata, handles);
    HIST=0; 
    if czy==0
        typ=typstart(handles,0); % packet type
        if strcmp(get(thandles.directcon, 'Checked'),'on')
            r=C1=='r' & C4==STARTWEZ & C3==AKTWEZ & typ;
        else
            r=C1=='r' & C4==STARTWEZ & C9==AKTWEZ & C10==STARTWEZ & typ;
        end
        c2=C2(r);
        c6=C6(r);
        opoz=[];
        if isempty(c2)==0        
        mc2=max(c2);
        czas=min(c2):BANDI:mc2;
        if czas(end)~=mc2
            czas=[czas,mc2];
        end    
            roz=length(czas);
            op=zeros(roz,1);
            band=op;
            band(1)=sum(c6(c2<=czas(1)))*8;
            for i=2:roz
                band(i)=sum(c6(c2>czas(i-1) & c2<=czas(i)))*8;
            end
            [opoz,id,stime,tr]=wezdel(handles,1);
            tr=tr(2:end);
            opoz=abs(opoz(2:end)-opoz(1:(end-1)));
            o=opoz(tr>0 & tr<=czas(1));
            if isempty(o)
                op(1)=0;
            else
                op(1)=mean(o);
            end    
            for i=2:roz
                o=opoz(tr>czas(i-1) & tr<=czas(i));
                if isempty(o)
                    op(i)=0;
                else
                    op(i)=mean(o);
                end
            end
            opoz=op;
        end    
        if sum(opoz)==0
            hplot=wykrespusty(handles);
            zapisz_wykres(0, opis, handles);
            HIST=2; % empty graph
        else
            [band, index]=sort(band);
            opoz=opoz(index);
            bnd=usunpowt(band);
            op=zeros(length(bnd),1);
            for i=1:length(bnd)
                m=mean(opoz(band==bnd(i)));
                if isempty(m)==0
                    op(i)=m;
                end    
            end    
	    [hplot,bnd,op]=rysuj(bnd, op,handles);
            zapisz_wykres([bnd, op], opis, handles);
        end
        plot_info(opis, eventdata, hplot, handles);
	xylabel(['throughput of receiving bits at node ', num2str(STARTWEZ), ' [bits/TIL]'],['average jitter between node ', ...
	num2str(AKTWEZ),' and node ', num2str(STARTWEZ),' [sec]'], hplot, handles);
    end
else
    NET=0; % whole network
    czyscosie;
    HIST=3; % ON if CHECK(2)==0
    x={'throughput', BANDI};
    [czy, opis]=czyopis(x, h, eventdata, handles);
    HIST=0;
    if czy==0
        hplot=wykrespusty(handles);
        zapisz_wykres(0, opis, handles);
        plot_info(opis, eventdata, hplot, handles);
	xylabel(['throughput of receiving bits at node ', num2str(STARTWEZ), ' [bits/TIL]'],['average jitter between node ', ...
	num2str(AKTWEZ),' and node ', num2str(STARTWEZ),' [sec]'], hplot, handles);
    end
end
DELAY=0;
DC=0;
zapisz_wykres_jpg(opis,handles);

⌨️ 快捷键说明

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