⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 queuemmmk.h

📁 简单的 Discrete Event Simulator M/M/K/K queue 含Readme。 可在此基础上开发复杂的仿真程序 请用 tar -xzvf sim.tar.gz 解压
💻 H
字号:
/***************************************************************************                          queuemmmk.h  -  description                             -------------------    begin                : Thu Oct 16 2003 ***************************************************************************//*************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/#ifndef QUEUEMMMK_H#define QUEUEMMMK_Henum {ARR,DEP};                 // Define the event types#include "event.h"#include "rv.h"#include "event.h"class QueueMMmK {               // class for M/M/m/K queueing systemprivate:	int qm;				// Number of servers	int qK;				// Number of system capacity	EventList elist;    // Create event list	int Nsys;			// Number of customers in system	double area;		// For calculating E[N]and E[T]	double clock;		// System clock	int Ndep ;          // Number of departures from system    int Nqueue;         // Number of customers waiting in the queue    int Nblock;         // Number of customers blocked    int Narr;           // Number of customers arrivedpublic:    double lambda;      // Arrival rate    double mu;			// Service rate    double rho()        // load    {        return lambda/mu/qm;    }    double ave_size()    // average system size    {        return area/clock;    }    double ave_time()   // average time spent in system    {        return area/(Narr-Nblock);    }    double blocking()   // blocking rate    {        return (double) Nblock / Narr;    }    double exp_size();  // expected number of customers in system    double exp_time();  // expected time in system    double exp_blocking();  // expected blockingpublic:    void reset();       // initialize states and statistics	void simulate(int departures);    // simulate for a certain number of departures	QueueMMmK(int m, int K):qm(m),qK(K){}	~QueueMMmK();};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -