A compact, performance-oriented implementation of a blocking system with m parallel servers and no waiting room. Built entirely in Zig, with custom sampling routines, tight memory patterns, and minimal allocation overhead. The project explores how different arrival and service-time models influence blocking probability, using large-scale simulations to estimate the fraction of rejected customers and associated confidence intervals.
The baseline uses Poisson arrivals with exponential service times and is validated against the analytical Erlang-B formula. Additional experiments replace the arrival process with renewal models (Erlang and hyper-exponential) and vary service distributions while keeping the mean fixed. The goal is to study how these structural changes affect blocking behaviour and the width of confidence intervals across scenarios.
This repository contains:
- The compiled executable (
./executable) - The full Zig source code (Zig 0.14.1)
- No Zig installation is required unless you wish to inspect or recompile the code.
├── build.zig # Build script (only needed for recompilation)
├── build.zig.zon # Package config (optional)
├── executable # Precompiled binary
└── src/
├── analysis.zig
├── main.zig # Program Entry Point
├── root.zig # Top-level file used in build.zig
├── sampling.zig
├── statistics.zig
└── system.zig
From the root directory:
./executableIf you’re on macOS or Linux and get a permissions error:
chmod +x executable
./executableIf you want to compile and run the code:
- Install Zig 0.14.1
- Run:
zig build run