91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1KB
    文件類(lèi)型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-04
  • 語(yǔ)言: Matlab
  • 標(biāo)簽: Gilbert??Elliot??Model??丟包??

資源簡(jiǎn)介

網(wǎng)絡(luò)數(shù)據(jù)包丟失模型matlab代碼 Gilbert Elliot Model 丟包模型

資源截圖

代碼片段和文件信息

%If?p?is?the?probability?of?transferring?from?Good?State?to?the?bad?state
%and?if?r?is?the?probability?of?transferring?from?the?bad?state?to?the?Good
%state?given?the?p?and?r?values?this?code?will?generate?a?packet?loss
%pattern?(with?burst?losses)?and?save?it?to?a?file?named?Loss_Pattern.txt.

clc

p?=?0.02777;
r?=?0.25;
total_packs?=?10000;

check?=?100;

while?check?>=?10

good?=?1;
packets?=?[];

size?=?1;

while?size?<=?total_packs
if?good?==?1
????packets?=?[packets?good];
????good?=?rand(1)?>?p;
elseif?good?==?0
????packets?=?[packets?good];
????good?=?rand(1)?>?(1-r);
else
????fprintf(‘error\n‘);
????break;
end
size?=?size?+?1;
end

fid?=?fopen(‘Loss_Pattern.txt‘‘w‘);
fprintf(fid?‘%d?‘?packets);
fclose(fid);
received_packs?=?nnz(packets);
theo_pack_loss_rate?=?1?-?r?/?(p+r);
act_pack_loss_rate?=?1?-?received_packs/total_packs;

check?=?abs(theo_pack_loss_rate?-?act_pack_loss_rate)?/?theo_pack_loss_rate?*?100;

end


packets
theo_pack_loss_rate?=?p?/?(p+r)
act_pack_loss_rate?=?1?-?received_packs/total_packs

?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件????????1082??2017-09-25?19:49??Gilbert?Elliot?Model.m
?????文件???????20000??2017-09-25?19:55??Loss_Pattern.txt

評(píng)論

共有 條評(píng)論