Skip to content

developer-kamran/Diagnostic-Lab-Simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚗️ DL Simulator — Dr. Essa Laboratory

A discrete-event queueing model simulator built for the Dr. Essa Diagnostic Laboratory. Models patient flow at the front desk during peak hours (9:00 AM – 11:00 AM) using analytical queueing theory formulas.

📸 Overview

The system allows users to configure queueing parameters and instantly compute key performance metrics such as average waiting time, queue length, server utilization, idle time, and lab throughput — for five queueing models with full multi-server support.


🧮 Supported Models

Model Arrival Service Multi-Server Support
M/M/s Exponential Exponential ✅ Exact (Erlang-C)
M/G/s Exponential General ✅ Cosmetatos Approximation
G/G/s General General ✅ Extended Kingman Approximation (Whitt)
M/M/1 Exponential Exponential (Single-server case of M/M/s)
M/G/1 Exponential General (Single-server case of M/G/s)
G/G/1 General General (Single-server case of G/G/s)

Supported General Distributions (G)

  • Uniform — parameterized by Minimum and Maximum
  • Normal — parameterized by Mean and Variance
  • Gamma — parameterized by Mean and Variance

📊 Performance Metrics Calculated

  • λ — Arrival rate (patients/min)
  • μ — Service rate (patients/min)
  • ρ — Server utilization (per server)
  • Idle Time — Fraction of time servers are idle
  • Lq — Average number of patients waiting in queue
  • L — Average number of patients in the system
  • Wq — Average waiting time in queue (minutes)
  • W — Average total time in system (minutes)
  • Throughput — Expected patients served in 120 minutes
  • Stability Status — Whether the system is stable (ρ < 1)

⚙️ Prerequisites

Make sure you have the following installed on your system before running the project:

  • .NET 8 SDK — required to build and run the backend API. Verify with dotnet --version.
  • Node.js (v18 or higher) — required for the Next.js frontend
  • npm (comes with Node.js)

🚀 Getting Started

1. Clone the Repository

git clone https://github.com/developer-kamran/Diagnostic-Lab-Simulator.git
cd Diagnostic-Lab-Simulator

2. Run the Backend (ASP.NET Core API)

cd backend/DLSimulator.API
dotnet run

The API will start at http://localhost:5000. Swagger UI is available at http://localhost:5000/swagger.

3. Run the Frontend (Next.js)

Open a new terminal:

cd frontend
npm install
npm run dev

The frontend will start at http://localhost:3000.


🔌 API Endpoint

POST /api/queue/calculate

Request Body Example (M/M/s — Multi-server):

{
  "modelType": 0, // 0 = M/M/s, 1 = M/G/s, 2 = G/G/s
  "arrivalDistribution": 0, // 0 = Exponential
  "arrivalMean": 5,
  "serviceDistribution": 0, // 0 = Exponential
  "serviceMean": 3,
  "numberOfServers": 3,
  "simulationDuration": 120
}

Request Body Example (G/G/s with Uniform distributions):

{
  "modelType": 2, // 0 = M/M/s, 1 = M/G/s, 2 = G/G/s
  "arrivalDistribution": 1, // 1 = Uniform, 2 = Normal, 3 = Gamma
  "arrivalMin": 2,
  "arrivalMax": 8,
  "serviceDistribution": 1, // 1 = Uniform, 2 = Normal, 3 = Gamma
  "serviceMean": 4,
  "serviceVariance": 2,
  "numberOfServers": 2,
  "simulationDuration": 120
}

Response:

{
  "modelType": 0, // 0 = M/M/s, 1 = M/G/s, 2 = G/G/s
  "numberOfServers": 1,
  "lambda": 0.2,
  "mu": 0.3333,
  "rho": 0.6,
  "idleTime": 0.4,
  "lq": 0.9,
  "l": 1.5,
  "wq": 4.5,
  "w": 7.5,
  "throughput": 24.0,
  "isStable": true,
  "stabilityMessage": null
}

🛠️ Tech Stack

Layer Technology
Backend C# ASP.NET Core 8 Web API
Frontend Next.js 14, Tailwind CSS

📄 License

This project was developed for academic purposes as part of CSSE-607 — Modeling and Simulation.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors