資源簡介
在matlab中對使用了ALOHA協議的系統進行用戶數量和碰撞率關系的仿真
代碼片段和文件信息
Vel=10;
%?the?velocity?of?the?data?flow??(信息傳輸速率λ??)
Tplen=0.03125;
%?the?length?of?the?frame?in?second?(Pflens)
ta=1;
%?the?reading?time
x1=0;
y1=0;
k=1:7;
for?NUM=1:1:7;???????
??for?i=1:100
????for?j=0:1:(i-1)
?????????x=exp(-1*Vel*(ta-j*Tplen))*((Vel*(ta-j*Tplen)).^j)/factorial(j);
?????????x1=x1+x;
????end????
??????y=(1-exp(-2*Vel*Tplen*(NUM-1))).^(i-1)*x1;
??????y1=y1+y;
??????x1=0;
??end
??Pfr0(NUM)=exp(-2*Vel*Tplen*(NUM-1))*y1
??y1=0;
end
ta=2;
%?the?reading?time
x1=0;
y1=0;
k=1:7;
for?NUM=1:1:7;???????
??for?i=1:100
????for?j=0:1:(i-1)
?????????x=exp(-1*Vel*(ta-j*Tplen))*((Vel*(ta-j*Tplen)).^j)/factorial(j);
?????????x1=x1+x;
????end????
??????y=(1-exp(-2*Vel*Tplen*(NUM-1))).^(i-1)*x1;
??????y1=y1+y;
??????x1=0;
??end
??Pfr1(NUM)=exp
評論
共有 條評論