收藏 分销(赏)

排队论的matlab仿真(包括仿真代码).doc

上传人:w****g 文档编号:2773319 上传时间:2024-06-05 格式:DOC 页数:21 大小:704.54KB
下载 相关 举报
排队论的matlab仿真(包括仿真代码).doc_第1页
第1页 / 共21页
排队论的matlab仿真(包括仿真代码).doc_第2页
第2页 / 共21页
排队论的matlab仿真(包括仿真代码).doc_第3页
第3页 / 共21页
排队论的matlab仿真(包括仿真代码).doc_第4页
第4页 / 共21页
排队论的matlab仿真(包括仿真代码).doc_第5页
第5页 / 共21页
点击查看更多>>
资源描述

1、(完整版)排队论的matlab仿真(包括仿真代码)Wireless NetworkExperiment Three:Queuing TheoryABSTRACTThis experiment is designed to learn the fundamentals of the queuing theory。 Mainly about the M/M/S and M/M/n/n queuing models.KEY WORDS: queuing theory, M/M/s, M/M/n/n, Erlang B, Erlang C。INTRODUCTIONA queue is a waitin

2、g line and queueing theory is the mathematical theory of waiting lines。 More generally, queueing theory is concerned with the mathematical modeling and analysis of systems that provide service to random demands。 In communication networks, queues are encountered everywhere。 For example, the incoming

3、data packets are randomly arrived and buffered, waiting for the router to deliver。 Such situation is considered as a queue. A queueing model is an abstract description of such a system。 Typically, a queueing model represents (1) the systems physical configuration, by specifying the number and arrang

4、ement of the servers, and (2) the stochastic nature of the demands, by specifying the variability in the arrival process and in the service process. The essence of queueing theory is that it takes into account the randomness of the arrival process and the randomness of the service process。 The most

5、common assumption about the arrival process is that the customer arrivals follow a Poisson process, where the times between arrivals are exponentially distributed. The probability of the exponential distribution function is 。l Erlang B modelOne of the most important queueing models is the Erlang B m

6、odel (i.e。, M/M/n/n)。 It assumes that the arrivals follow a Poisson process and have a finite n servers. In Erlang B model, it assumes that the arrival customers are blocked and cleared when all the servers are busy. The blocked probability of a Erlang B model is given by the famous Erlang B formula

7、,where n is the number of servers and A= is the offered load in Erlangs, is the arrival rate and is the average service time. Formula (1.1) is hard to calculate directly from its right side when n and A are large. However, it is easy to calculate it using the following iterative scheme:l Erlang C mo

8、delThe Erlang delay model (M/M/n) is similar to Erlang B model, except that now it assumes that the arrival customers are waiting in a queue for a server to become available without considering the length of the queue。 The probability of blocking (all the servers are busy) is given by the Erlang C f

9、ormula,Where if and if 。 The quantity indicates the server utilization. The Erlang C formula (1.3) can be easily calculated by the following iterative schemewhere is defined in Eq。(1.1).DESCRIPTION OF THE EXPERIMENTS1. Using the formula (1。2), calculate the blocking probability of the Erlang B model

10、。 Draw the relationship of the blocking probability PB(n,A) and offered traffic A with n = 1,2, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100. Compare it with the table in the text book (P。281, table 10.3)。From the introduction, we know that when the n and A are large, it is easy to calculate the blocking

11、 probability using the formula 1.2 as follows. it use the theory of recursion for the calculation。 But the denominator and the numerator of the formula both need to recurs() when doing the matlab calculation, it waste time and reduce the matlab calculation efficient. So we change the formula to be :

12、 Then the calculation only need recurs once time and is more efficient.The matlab code for the formula is: erlang_b.m* File: erlanb_b.m A = offered traffic in Erlangs。 n = number of truncked channels. Pb is the result blocking probability. %*function Pb = erlang_b( A,n ) if n=0 Pb=1; % P(0,A)=1 else

13、 Pb=1/(1+n/(A*erlang_b(A,n1); % use recursion erlang(A,n1) endendAs we can see from the table on the text books, it uses the logarithm coordinate, so we also use the logarithm coordinate to plot the result。 We divide the number of servers(n) into three parts, for each part we can define a interval o

14、f the traffic intensity(A) based on the figure on the text books : 1. when 0n10, 0。1A10.2。 when 10n20, 3A20.3。 when 30serv_desk(k) serv_desk(k)=zero_time; else continue end end else %if no customer leave before the NO。i customer arrive block_num=block_num+1; block_line=block_line+1; end end else %th

15、e situation that the queue length is not zero n=0; compute the number of leaing customer before the NO.i customer arrives for k=1:server_num if arr_time(i)serv_desk(k) n=n+1; serv_desk(k)=zero_time; else continue end end for k=1:block_line if arr_time(i)state(5,ik) n=n+1; else continue end end if nblock_line+1 nblock_line+1 means the queue length is still not zero block_num=block_num+1; for k=0:n-1 if state(5,iblock_line+k)arr_time(i) for m=1:server_num if serv_desk(m)=zero_time serv_desk(m)=state(5,i-block_line+k)

展开阅读全文
相似文档                                   自信AI助手自信AI助手
猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服