matlab模拟排队论,排队论的matlab仿真(包括仿真代码)

《排队论的matlab仿真(包括仿真代码)》由会员分享,可在线阅读,更多相关《排队论的matlab仿真(包括仿真代码)(22页珍藏版)》请在人人文库网上搜索。

1、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 waiting line and queueing theor。

2、y 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 data packets are randomly。

3、 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 arrangement of the servers, and。

4、 (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 common assumption about t。

5、he 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 ft=e-t.l Erlang B modelOne of the most important queueing models is the Erlang B model (i.e., M/M/n/n。

6、). 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,where n is the num。

7、ber of servers and A=/ is the offered load in Erlangs, is the arrival rate and 1/ 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 modelThe Erlang d。

8、elay 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 formula,Where =1。

9、 if An and =An if Amin(serv_desk) state(3,i)=0; else state(3,i)=min(serv_desk)-arr_time(i); %when customer NO.i arrives and the%server is all busy, the waiting time can be compute by%minus arriving time from the minimum leaving timeend state(5,i)=sum(state(:,i); for j=1:server_num if serv_desk(j)=mi。

10、n(serv_desk) serv_desk(j)=state(5,i); break end %replace the minimum leaving time by the first waiting customers leaving time end end %second part: compute the queue length during the whole service interval%zero_time=0;%zero_time is used to identify which server is empty serv_desk(1:server_num)=zero。

11、_time; block_num=0; block_line=0; for i=1:peo_num if block_line=0 find_max=0; for j=1:server_num if serv_desk(j)=zero_time find_max=1; %means there is empty serverbreak else continue end end if find_max=1 %update serv_deskserv_desk(j)=state(5,i); for k=1:server_num if serv_desk(k)min(serv_desk) %if 。

12、a customer will leave before the NO.i%customer arrivefor k=1:server_num if arr_time(i)serv_desk(k) serv_desk(k)=state(5,i); break else continue end end for k=1:server_num if arr_time(i)serv_desk(k) serv_desk(k)=zero_time; else continue end end else %if no customer leave before the NO.i customer arri。

13、veblock_num=block_num+1; block_line=block_line+1; end end else %the situation that the queue length is not zeron=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。

14、_line if arr_time(i)state(5,i-k) n=n+1; else continue end end if narr_time(i) for m=1:server_num if serv_desk(m)=zero_time serv_desk(m)=state(5,i-block_line+k) break else continue end end else continue end end block_line=block_line-n+1; else %n=block_line+1 means the queue length is zero%update serv。

15、_desk and queue lengthfor k=0:block_line if arr_time(i) mu*server_num, system will crash as the waiting time and queue length increases as new customer arrives. For the situation of lamdamu*server_num, the system performs better when mu and server_num are both not small. If the mu is smaller than la。

16、mda or we only have one server though with large mu, the system works not very good. It is may be because that the server time for each customer is a Poisson distribution, it may be a large time though the mu is large enough, so the more number of server, the better of the performance of the system.CONCLUSTIONAfter the experiment, we have a deeply under。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值