首页 排队论经典程序MM1代码

排队论经典程序MM1代码

举报
开通vip

排队论经典程序MM1代码修理店仿真报告 一.问题: ①修理店空闲的概率; ②店内有三个顾客的概率; ③店内至少有一个顾客的概率; ④在店内顾客的平均数; ⑤顾客在店内的平均逗留时间; ⑥顾客必须在店内消耗15分钟以上的概率。 二.求解问题的方法: ①修理店空闲的概率: (sim_time-area_server_status) / sim_time); ②店内有三个顾客的概率: area_3_in_q/sim_time); ③店内至少有一个顾客的概率: abv_1/sim_time); ④在店内顾客的平均数...

排队论经典程序MM1代码
修理店仿真报告 一.问 快递公司问题件快递公司问题件货款处理关于圆的周长面积重点题型关于解方程组的题及答案关于南海问题 : ①修理店空闲的概率; ②店内有三个顾客的概率; ③店内至少有一个顾客的概率; ④在店内顾客的平均数; ⑤顾客在店内的平均逗留时间; ⑥顾客必须在店内消耗15分钟以上的概率。 二.求解问题的 方法 快递客服问题件处理详细方法山木方法pdf计算方法pdf华与华方法下载八字理论方法下载 : ①修理店空闲的概率: (sim_time-area_server_status) / sim_time); ②店内有三个顾客的概率: area_3_in_q/sim_time); ③店内至少有一个顾客的概率: abv_1/sim_time); ④在店内顾客的平均数: area_num_in_h/sim_time); ⑤顾客在店内的平均逗留时间: (total_of_delays+total_of_server)/ num_custs_delayed ); ⑥顾客必须在店内消耗15分钟以上概率: abv_15/num_custs_delayed); 三。求解过程中计算统计量的方法: ①area_server_status += server_status * time_since_last_event; ②//店内有三个顾客的概率 if(server_status == BUSY) //服务台忙,则有队列中有两个顾客 if(num_in_q == 2) area_3_in_q += time_since_last_event; ③//店内至少有一个顾客的概率 if(server_status == BUSY) //服务台忙,则店内至少有一个顾客 abv_1 += time_since_last_event; ④//在店内顾客的平均数 if(server_status == BUSY) //服务台忙,总的顾客数为排队顾客数加一 area_num_in_h += (num_in_q+1) * time_since_last_event; ⑤total_of_server += time_next_event[2]-sim_time;//总的服务时间加一个服务时间为新的服务总时间 delay = sim_time - time_arrival[1];//排队时间=当前时间-这个人来的时间 total_of_delays += delay; ⑥//离开时总的消耗时间大于15,必须在店内消耗15分钟以上的顾客数加一 if((delay+time_next_event[2]-sim_time)>15) abv_15++; //到达时总的服务时间大于15,必须在店内消耗15分钟以上的顾客数加一 if((time_next_event[2]-sim_time)>15) abv_15++; 程序代码: /* External definitions for single-server queueing system. */ #include #include /*#include "lcgrand.h" Header file for random-number generator. */ #define Q_LIMIT 100 /* Limit on queue length.队伍最长100人*/ #define BUSY 1 /* Mnemonics for server's being busy 忙碌状态*/ #define IDLE 0 /* and idle.空闲状态*/ int next_event_type, //下一个事件类型 num_custs_delayed, //已模拟的顾客数 num_delays_required, //模拟的顾客数 num_events,//事件数 num_in_q, //队列中的顾客数 server_status;//服务状态 float area_num_in_q,//有顾客的时间 area_server_status,//总的服务时间 mean_interarrival,//平均顾客到达时间间隔 mean_service,//平均服务时间 sim_time, //模拟时间 time_arrival[Q_LIMIT + 1], //到来的时间 time_last_event, //上一个事件的时间 time_next_event[3],//下一个事件的时间 total_of_delays; //总的排队时间 //////////////////////////////////////////////////////////////////////////////////// //添加的变量 float abv_15, //15分钟以上的顾客数量 total_of_server, //所有顾客的总的服务时间 area_3_in_q, //有3个顾客的时间 abv_1, //至少有一个顾客的时间 area_num_in_h; //顾客总数 //////////////////////////////////////////////////////////////////////////////////// file *infile, *outfile; /* The following 3 declarations are for use of the random-number generator lcgrand and the associated functions lcgrandst and lcgrandgt for seed management. This file (named lcgrand.h) should be included in any program using these functions by executing #include "lcgrand.h" before referencing the functions. */ float lcgrand(int stream); void lcgrandst(long zset, int stream); long lcgrandgt(int stream); void initialize(void); void timing(void); void arrive(void); void depart(void); void report(void); void update_time_avg_stats(void); float expon(float mean); main() /* Main function. */ { /* Open input and output files. */
本文档为【排队论经典程序MM1代码】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_842972
暂无简介~
格式:doc
大小:19KB
软件:Word
页数:6
分类:
上传时间:2019-05-30
浏览量:38