排队论的matlab仿真(包括仿真代码)Word文档下载推荐.docx

上传人:wj 文档编号:13016037 上传时间:2022-10-02 格式:DOCX 页数:21 大小:524.61KB
下载 相关 举报
排队论的matlab仿真(包括仿真代码)Word文档下载推荐.docx_第1页
第1页 / 共21页
排队论的matlab仿真(包括仿真代码)Word文档下载推荐.docx_第2页
第2页 / 共21页
排队论的matlab仿真(包括仿真代码)Word文档下载推荐.docx_第3页
第3页 / 共21页
排队论的matlab仿真(包括仿真代码)Word文档下载推荐.docx_第4页
第4页 / 共21页
排队论的matlab仿真(包括仿真代码)Word文档下载推荐.docx_第5页
第5页 / 共21页
点击查看更多>>
下载资源
资源描述

排队论的matlab仿真(包括仿真代码)Word文档下载推荐.docx

《排队论的matlab仿真(包括仿真代码)Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《排队论的matlab仿真(包括仿真代码)Word文档下载推荐.docx(21页珍藏版)》请在冰豆网上搜索。

排队论的matlab仿真(包括仿真代码)Word文档下载推荐.docx

INTRODUCTION

Aqueueisawaitinglineandqueueingtheoryisthemathematicaltheoryofwaitinglines.Moregenerally,queueingtheoryisconcernedwiththemathematicalmodelingandanalysisofsystemsthatprovideservicetorandomdemands.Incommunicationnetworks,queuesareencounteredeverywhere.Forexample,theincomingdatapacketsarerandomlyarrivedandbuffered,waitingfortheroutertodeliver.Suchsituationisconsideredasaqueue.Aqueueingmodelisanabstractdescriptionofsuchasystem.Typically,aqueueingmodelrepresents

(1)thesystem'

sphysicalconfiguration,byspecifyingthenumberandarrangementoftheservers,and

(2)thestochasticnatureofthedemands,byspecifyingthevariabilityinthearrivalprocessandintheserviceprocess.

Theessenceofqueueingtheoryisthatittakesintoaccounttherandomnessofthearrivalprocessandtherandomnessoftheserviceprocess.ThemostcommonassumptionaboutthearrivalprocessisthatthecustomerarrivalsfollowaPoissonprocess,wherethetimesbetweenarrivalsareexponentiallydistributed.Theprobabilityoftheexponentialdistributionfunctionisft=λe-λt.

lErlangBmodel

OneofthemostimportantqueueingmodelsistheErlangBmodel(i.e.,M/M/n/n).ItassumesthatthearrivalsfollowaPoissonprocessandhaveafinitenservers.InErlangBmodel,itassumesthatthearrivalcustomersareblockedandclearedwhenalltheserversarebusy.TheblockedprobabilityofaErlangBmodelisgivenbythefamousErlangBformula,

wherenisthenumberofserversandA=λ/μistheofferedloadinErlangs,λisthearrivalrateand1/μistheaverageservicetime.Formula(1.1)ishardtocalculatedirectlyfromitsrightsidewhennandAarelarge.However,itiseasytocalculateitusingthefollowingiterativescheme:

lErlangCmodel

TheErlangdelaymodel(M/M/n)issimilartoErlangBmodel,exceptthatnowitassumesthatthearrivalcustomersarewaitinginaqueueforaservertobecomeavailablewithoutconsideringthelengthofthequeue.Theprobabilityofblocking(alltheserversarebusy)isgivenbytheErlangCformula,

Whereρ=1ifA>

nandρ=AnifA<

n.Thequantityρindicatestheserverutilization.TheErlangCformula(1.3)canbeeasilycalculatedbythefollowingiterativescheme

wherePB(n,A)isdefinedinEq.(1.1).

DESCRIPTIONOFTHEEXPERIMENTS

1.Usingtheformula(1.2),calculatetheblockingprobabilityoftheErlangBmodel.DrawtherelationshipoftheblockingprobabilityPB(n,A)andofferedtrafficAwithn=1,2,10,20,30,40,50,60,70,80,90,100.Compareitwiththetableinthetextbook(P.281,table10.3).

Fromtheintroduction,weknowthatwhenthenandAarelarge,itiseasytocalculatetheblockingprobabilityusingtheformula1.2asfollows.

PBn,A=APB(n-1,A)m+APB(n-1,A)

itusethetheoryofrecursionforthecalculation.Butthedenominatorandthenumeratoroftheformulabothneedtorecurs(PBn-1,A)whendoingthematlabcalculation,itwastetimeandreducethematlabcalculationefficient.Sowechangetheformulatobe:

PBn,A=APB(n-1,A)n+APB(n-1,A)=1n+APBn-1,AAPBn-1,A=1(1+nAPBn-1,A)

Thenthecalculationonlyneedrecursoncetimeandismoreefficient.

Thematlabcodefortheformulais:

erlang_b.m

%**************************************

%File:

erlanb_b.m

%A=offeredtrafficinErlangs.

%n=numberoftrunckedchannels.

%Pbistheresultblockingprobability.

function[Pb]=erlang_b(A,n)

ifn==0

Pb=1;

%P(0,A)=1

else

Pb=1/(1+n/(A*erlang_b(A,n-1)));

%userecursion"

erlang(A,n-1)"

end

end

Aswecanseefromthetableonthetextbooks,itusesthelogarithmcoordinate,sowealsousethelogarithmcoordinatetoplottheresult.Wedividethenumberofservers(n)intothreeparts,foreachpartwecandefineaintervalofthetrafficintensity(A)basedonthefigureonthetextbooks:

1.when0<

n<

10,0.1<

A<

10.

2.when10<

20,3<

20.

3.when30<

100,13<

120.

Foreachpart,usethe“erlang_b”functiontocalculateandthenuse“loglog”functiontofigurethelogarithmcoordinate.

Thematlabcodeis:

%*****************************************

%forthethreeparts.

%nisthenumberservers.

%Aisthetrafficindensity.

%Pistheblockingprobability.

n_1=[1:

2];

A_1=linspace(0.1,10,50);

%50pointsbetween0.1and10.

n_2=[10:

10:

20];

A_2=linspace(3,20,50);

n_3=[

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 幼儿教育 > 育儿理论经验

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1