PF模块案例(一) 上次小编为大家介绍了PF模块的基本操作,那么今天带大家简单地进行一个案例的运用。 LasttimetheeditorintroducedthebasicoperationofthePFmoduletoyou,sotodayIwilltakeyoutoasimplecaseapplication。 案例如下:每20秒有一位客户到达邮局。模拟时间间隔的最符合的分布是期望值为20的指数分布。 Thecaseisasfollows:acustomerarrivesatthepostofficeevery20seconds。Themostconsistentdistributionforthesimulationtimeintervalistheexponentialdistributionwithanexpectedvalueof20。 邮局窗口的服务时间为lognormal2(31,3。1,0。5)秒。 Theservicetimeofthepostofficewindowislognormal2(31,3。1,0。5)seconds。 若服务窗口前排队的队列超过20个人,新到的客户会成为(unhappycustomers),直接离开。 Iftherearemorethan20peopleinthequeuebeforetheservicewindow,newcustomerswillbecome(unhappycustomers)andleavedirectly。 在三维模型中,最重要的实体便是发生器,那么在PF模块也是如此,但是其中有三种发生器,恰好对应着三维模型中的三种到达方式。 Inthethreedimensionalmodel,thefinalentityisthegenerator,andsoisthePFmodule,buttherearethreetypesofgenerators,whichcorrespondexactlytothethreearrivalmethodsinthethreedimensionalmodel。 拖入发生器时间间隔活动,代表顾客,顾客到达系统后需要接收一个服务,在三维模式中经常会选用处理器,PF模块就需要选择延迟活动,表示需要停留一段时间,进入下一活动,完成延迟之后,就需要离开,我们就选择吸收器。这样就模拟了顾客的一个模型。在PF模块中,活动的属性都比较少,在右侧显示。 Draginthegeneratortimeintervalactivitytorepresentthecustomer。Afterthecustomerarrivesinthesystem,heneedstoreceiveaservice。Inthethreedimensionalmode,theprocessorisoftenselected。ThePFmoduleneedstoselectthedelayedactivity,whichmeansthatitneedstostayforawhile,enterthenextactivity,andcompleteAfterthedelay,weneedtoleaveandwechoosetheabsorber。Thissimulatesamodelofthecustomer。InthePFmodule,therearefeweractiveattributes,whicharedisplayedontheright。 接下来就进行参数设置,可以在属性中设置,也可以双击图标来进行参数设置,设置如下 Next,settheparameters,whichcanbesetintheproperties,oryoucandoubleclicktheicontosettheparameters,thesettingsareasfollows 现在运行结果如下,这个绿色的小圆点就是临时标识token,会慢慢地由浅绿色变成深绿色,表示运行过程。 Theresultsofthecurrentoperationareasfollows。Thesmallgreendotisthetemporarytoken,whichwillgraduallychangefromlightgreentodarkgreen,indicatingtheoperationprocess。 那么此模型还有些许不足,在现实生活中邮局是会有窗口限制的,因此还需要加上资源限制,还需要加入占用资源和释放资源活动,占用资源后面与其他活动有些许的不一样,后面会存在一个感叹号,是因为模型中或许会有多个资源,因此需要指定。 Thenthismodelhassomeshortcomings。Inreallife,thepostofficehaswindowrestrictions,soresourcerestrictionsneedtobeadded,andresourceoccupationandresourcereleaseactivitiesneedtobeadded。Theoccupationofresourcesisslightlydifferentfromotheractivities。Therewillbeanexclamationpointlaterbecausetheremaybemultipleresourcesinthemodel,sotheyneedtobespecified。 我们只需要将它指定一下就好了。点击感叹号,吸附资源就好,这时会出现一条蓝色的线,但是它会隐藏。 Weonlyneedtospecifyit。Clickontheexclamationmarktoabsorbresources。Atthistime,abluelinewillappear,butitwillbehidden。 有占用资源就需要利用到释放资源,但是释放资源与占用资源不一样,不需要特别的指引,因为它的默认方式就是释放上一个,但是也可以进行指引,一般情况下不需要 Ifresourcesareoccupied,theyneedtobeusedtoreleaseresources,butreleasingresourcesisnotthesameasoccupyingresources。Nospecialguidanceisneeded,becausethedefaultmethodistoreleasethepreviousone,butguidancecanalsobegiven。Generally,itisnotnecessary 运行结果如下,延迟的活动下只有一个临时标识,其他的便在占用资源里面,选中资源实体,绿色的标识会跟延时有连线表示正在服务,红色的标识会跟占用资源连接,表示正在请求服务或者是排队。 Theresultsoftheoperationareasfollows。Thereisonlyonetemporarylogounderthedelayedactivity,andtheothersareintheoccupiedresources。Selecttheresourceentity。Thegreenlogowillbeconnectedtothedelaytoindicatethatitisserving,andtheredlogowillbeconnectedtotheoccupiedresource,indicatingthattheresourceisbeingoccupied。Requestserviceorqueueup。 最后便需要完成20个人的限制,需要添加新的吸收器,代表流失顾客,而且还需要引用新的区域资源,以及进入区域活动。 Finally,the20personlimitneedstobecompleted,newabsorbersneedtobeaddedtorepresentlostcustomers,andnewregionalresourcesandaccesstoregionalactivitiesneedtobereferenced。 最终的模型如下 Thefinalmodelisasfollows 进行参数设置 Parametersetting 最终模型运行如下,满足排队不超过20人的限制。 Thefinalmodelrunsasfollows,meetingthelimitofnomorethan20peopleinthequeue。 以上便是本次的PF模型教学,希望对你们的学习有一定的帮助 TheaboveisthePFmodelteachingthistime。Ihopeitwillbehelpfultoyourstudy。 参考资料:腾讯课堂《从小白到大神》 英文翻译:Google翻译 本文由LearningYard学苑原创,若有侵权,请联系删除。