通信网实验报告吉大通信院.docx

上传人:b****7 文档编号:23707266 上传时间:2023-05-20 格式:DOCX 页数:20 大小:398.10KB
下载 相关 举报
通信网实验报告吉大通信院.docx_第1页
第1页 / 共20页
通信网实验报告吉大通信院.docx_第2页
第2页 / 共20页
通信网实验报告吉大通信院.docx_第3页
第3页 / 共20页
通信网实验报告吉大通信院.docx_第4页
第4页 / 共20页
通信网实验报告吉大通信院.docx_第5页
第5页 / 共20页
点击查看更多>>
下载资源
资源描述

通信网实验报告吉大通信院.docx

《通信网实验报告吉大通信院.docx》由会员分享,可在线阅读,更多相关《通信网实验报告吉大通信院.docx(20页珍藏版)》请在冰豆网上搜索。

通信网实验报告吉大通信院.docx

通信网实验报告吉大通信院

附录:

实验一:

路径选择实验

D算法:

%D算法—求V1点到其他各点的最短路径

functionyy_d

disp('D算法:

输入图G的全值矩阵W');

d=input('w=');

n=length(d);

fori=1:

n

d(i,i)=inf;

end

temp=[1];

path=zeros(n);

path(:

1)=ones(n,1);

w=d(1,:

);

w

(1)=0;

wgt=w;

x=1;

y=1;

fori=1:

n

a(i)=i;

end

disp('置定端集Gp:

');

fork=1:

n-1

min=inf;

p=length(temp);

q=length(wgt);

fori=1:

n

in1=find(temp==i);

forj=1:

n

in2=find(temp==j);

ifisempty(in1)&~isempty(in2)

ifwgt(i)>wgt(j)+d(j,i)wgt(i)=wgt(j)+d(j,i);

end

ifmin>wgt(i);

x=i;

min=wgt(i);

end

end

end

end

w(x)=wgt(x);

temp(p+1)=a(x);

fori=1:

n

ifw(x)==w(i)+d(i,x)

y=i;

end

end

l=1;

whilepath(y,l)~=0

l=l+1;

end

fori=1:

l-1

path(x,i)=path(y,i);

end

path(x,l)=a(x);

disp('运算次数k=');disp(k);

disp('此次运算得到的Gp:

');

disp(temp);

end

disp('V1到其他各点的最短路径及径长:

')

fori=1:

n

disp('目的节点i=');disp(i);

disp('最短路径:

')

disp(path(i,:

));

disp('径长:

')

disp(w(i));

end

figure

(1);

%holdoff;

clf;

axis([1,10,0,5]);

fork=1:

10

b(1,k)=k;

end

b(2,:

)=rand(1,10)*5;

text(1.05,b(2,1)+0.1,'v1');

text(2,b(2,2)+0.1,'v2');

text(3,b(2,3)+0.1,'v3');

text(4,b(2,4)+0.1,'v4');

text(5,b(2,5)+0.1,'v5');

text(6,b(2,6)+0.1,'v6');

text(7,b(2,7)+0.1,'v7');

%text(8,b(2,8)+0.1,'v8');

%text(9,b(2,9)+0.1,'v9');

%text(10,b(2,10)+0.1,'v10');

holdon;

fori=2:

n

idage=path(i,:

);

c=1;

whilec

f=idage(c);

g=idage(c+1);

s=[b(1,f),b(1,g)];

t=[b(2,f),b(2,g)];

plot(s,t);

holdon;

c=c+1;

end

end

fore=1:

n

plot(b(1,e)-0.01,b(2,e),'bd');

end

title('D算法')

%end

D算法作为检验作业时的运行结果:

D算法:

输入图G的全值矩阵W

w=[0913infinf;104inf7inf;2inf0inf1inf;infinf5027;inf62805;7inf2inf20];

置定端集Gp:

运算次数k=

1

此次运算得到的Gp:

13

运算次数k=

2

此次运算得到的Gp:

135

运算次数k=

3

此次运算得到的Gp:

1354

运算次数k=

4

此次运算得到的Gp:

13546

运算次数k=

5

此次运算得到的Gp:

135462

V1到其他各点的最短路径及径长:

目的节点i=

1

最短路径:

100000

径长:

0

目的节点i=

2

最短路径:

135200

径长:

8

目的节点i=

3

最短路径:

130000

径长:

1

目的节点i=

4

最短路径:

140000

径长:

3

目的节点i=

5

最短路径:

135000

径长:

2

目的节点i=

6

最短路径:

135600

径长:

7

%F算法—求解各端点之间的最短路径

functionyy_f

disp('F算法:

输入图G的权值矩阵W0');

w0=input('w0=');

n=length(w0);

r0=zeros(n);

fori=1:

n

forj=1:

n

ifw0(i,j)~=inf&i~=j

r0(i,j)=j;

else

r0(i,j)=0;

end

end

end

disp(w0);

disp(r0);

fork=1:

n

fori=1:

n

forj=1:

n

ifi~=j&w0(i,j)>w0(i,k)+w0(k,j)

w0(i,j)=w0(i,k)+w0(k,j);

r0(i,j)=k;

end

end

end

forx=1:

n

r0(x,x)=0;

end

disp('节点k=');disp(k);

disp('作为中间转接点时得到的W和R:

')

disp(w0);

disp(r0);

end

F算法检验作业时的运行结果:

图G的权值矩阵W0

w0=[0913infinf;104inf7inf;2inf0inf1inf;infinf5027;inf62805;7inf2inf20]

0913InfInf

104Inf7Inf

2Inf0Inf1Inf

InfInf5027

Inf62805

7Inf2Inf20

023400

103050

100050

003056

023406

103050

节点k=1

作为中间转接节点时得到的W和R:

0913InfInf

10247Inf

211051Inf

InfInf5027

Inf62805

71621020

023400

101150

110150

003056

023406

113150

节点k=2

作为中间转接节点时得到的W和R:

091316Inf

10247Inf

211051Inf

InfInf5027

762805

71621020

023420

101150

110150

003056

223406

113150

节点k=3

作为中间转接节点时得到的W和R:

09132Inf

10243Inf

211051Inf

7165027

462705

4132720

023430

101130

110150

333056

323306

333350

节点k=4

作为中间转接节点时得到的W和R:

0913210

1024311

21105112

7165027

462705

4132720

023434

101134

110154

333056

323306

333350

节点k=5

作为中间转接节点时得到的W和R:

081327

102438

270516

684027

462705

482720

053435

101135

150155

555056

323306

353350

节点k=6

作为中间转接节点时得到的W和R:

081327

102438

270516

684027

462705

482720

053435

101135

150155

555056

323306

353350

 

附录:

实验二:

通信业务量分析实验

算法:

functionErlangB

pn=[];

s=[];

x=0.1:

0.1:

100;

m=[1234567891015203035405060708090100];

L=length(m);

fori=1:

L

fora=0.1:

0.1:

100

fork=0:

m(i)

s=[s,a.^k/factorial(k)];

add=sum(s);

end

pn0=(a.^m(i)/factorial(m(i)))./add;

pn=[pn,pn0];

s=[];

end

loglog(x,pn);

set(gca,'Xlim',[0.1100]);

set(gca,'XGrid','on');

set(gca,'XMinorTick','off');

set(gca,'XTick',[0.11.010.0100]);

%set(gca,'XMinorGrid','off');

set(gca,'Ylim',[0.0010.1]);

set(gca,'YGrid','on');

set(gca,'YMinorTick','off');

%set(gca,'YTick',[0.0010.0020.0050.010.020.050.1]);

%set(gca,'YMinorGrid','off');

holdon

pn=[];

end

xlabel('话务量强度a(erl)','fontsize',8);

ylabel('呼损率Pc','fontsize',8);

holdoff

gtext('0.002');

gtext('0.005');

gtext('0.02');

gtext('0.05');

gtext('m=1','fontsize',15);

fori=2:

L

gtext('m=','fontsize',15);

gtext(int2str(m(i)),'fontsize',15);

end

实验运行结果:

functionErlangC

pc=[];

s=[];

m=[1234567891015203035405060708090100];

L=length(m);

fori=1:

L

fora=1:

100

ifa<=m(i)

fork=0:

(m(i)-1)

s=[s,a.^k/factorial(k)];

add=sum(s);

end

pc0=a.^m(i)/(a.^m(i)+factorial(m(i))*(1-a/m(i))*add);

pc=[pc,pc0];

s=[];

end

end

x=1:

length(pc);

loglog(x,pc);

set(gca,'XGrid','on');

set(gca,'XMinorTick','off');

set(gca,'Xlim',[1100]);

%set(gca,'XTick',[0.10.20.5125102050100]);

%set(gca,'XMinorGrid','off');

set(gca,'Ylim',[0.011]);

set(gca,'YGrid','on');

%set(gca,'YMinorTick','off');

holdon

pc=[];

end

xlabel('话务量强度a(erl)','fontsize',8);

ylabel('呼叫等待概率Pw','fontsize',8);

gtext('0.02');

gtext('0.05');

gtext('0.2');

gtext('0.5');

gtext('m=1','fontsize',15);

fori=2:

L

gtext('m=','fontsize',15);

gtext(int2str(m(i)),'fontsize',15);

end

实验运行结果:

 

附录:

实验三:

Gompertz(龚伯兹)模型实验

实验运行结果

实验四:

Logistic(罗吉特)模型实验

实验运行结果

 

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 法律文书 > 调解书

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1