ISDN网络模型

clear all;
clc;
s1=0;
for u=1:20
    for t=1:20
        ton([u],[t])=0.35*6*randint(1,1,[0,1]);
        
    end;
end;
for u=1:20
    for t=1:20
        s1=ton([u],[t])+s1;
        totalonvoice(t)=s1;
    end;
    s1=0;
end;
[d]=1000*[0 128 512 1024];
s2=0;
for u=1:20
    for t=1:20
        ton([u],[t])=0.35*randint(1,1,[0,1]);
    end;
end;
for u=1:20
    for t=1:20
        if((ton([u],[t])>=0)&(ton([u],[t])<=2))
            tond([u],[t])=ton([u],[t])*d(1);
        end;
        if((ton([u],[t])>=3)&(ton([u],[t])<=5))
            tond([u],[t])=ton([u],[t])*d(2);
        end;
        if((ton([u],[t])>=6)&(ton([u],[t])<=8))
            tond([u],[t])=ton([u],[t])*d(3);
        end;
        if((ton([u],[t])>=9)&(ton([u],[t])<=10))
            tond([u],[t])=ton([u],[t])*d(4);
        end;
    end;
end;
for t=1:20
    for u=1:20
        s2=(tond([u],[t]))+s2;
        totalondata(t)=s2;
    end;
    s2=0;
end;
[x]=randint(1,1,[1,5]);
s3=0;
a=20;
[p]=[0 0 0.5 0.5; 0.117 0 0.33 0.5; 0.4 0.2 0 0.4; 2 0.3 0.5 0];
ts1=exppdf(x,7);
ts2=exppdf(x,1);
ts3=exppdf(x,3);
ts4=exppdf(x,4);
[d]=[3.75 2.9 3.4 6]*power(10,6);
for u=1:20
    for t=1:5
        p1([u],[t])=ts1*p(1,3)*d(1)*a;
    end;
    for t=6:10
        p1([u],[t])=ts2*p(2,4)*d(2)*a;
    end;
    for t=11:15
        p1([u],[t])=ts3*p(3,2)*d(3)*a;
    end;
    for t=16:20
        p1([u],[t])=ts4*p(4,2)*d(4)*a;
    end;
end;
s5=0;
for u=1:20
    for t=1:20
        s3=p1([u],[t])+s3;
        totalonvideo(t)=s3;
    end;
    s3=0;
end;
buffer(1)=0;
for t=1:20
    totaltraffic(t)=0.05*totalondata(t)+.15*totalonvoice(t)+0.8*totalonvideo(t);
    buffer(t+1)=totalondata(t)-0.05*totalondata(t)+totalonvoice(t)-0.15*totalonvoice(t)+totalonvideo(t)-0.8*totalonvideo(t);
    totaltraffic(t+1)=totaltraffic(t)+buffer(t+1);
    if totalonvideo(t)<23.25*10^6
        totaltraffic(t)=totalondata(t)+totalonvoice(t)+0.8+totalonvideo(t)+buffer(t+1);
    end;
end;
bar(totaltraffic);
totaltraffic
for i=1:20
    if(totaltraffic(i)<=155*power(10,6))
        rem(i)=0;
    else
        rem(i)=totaltraffic(i)-(155*power(10,6))
    end;
end;
rem
xlabel('time');
ylabel('traffic');
title('ISDN traffic model');

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

fpga和matlab

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值