修理店仿真报告
一.问
题
快递公司问题件快递公司问题件货款处理关于圆的周长面积重点题型关于解方程组的题及答案关于南海问题
:
①修理店空闲的概率;
②店内有三个顾客的概率;
③店内至少有一个顾客的概率;
④在店内顾客的平均数;
⑤顾客在店内的平均逗留时间;
⑥顾客必须在店内消耗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. */