1function [W,rhohat]=qsys_gigk_approx_cosmetatos(lambda,mu,ca,cs,k)
2% [W,RHOHAT]=QSYS_GIGK_APPROX_COSMETATOS(LAMBDA,MU,CA,CS,K)
4% G/G/k queue approximation
using the Cosmetatos method.
5% Adjusts the M/M/k results based on the variability of arrival
6% and service processes.
10% MU - Service rate per server
11% CA - Coefficient of variation of inter-arrival time
12% CS - Coefficient of variation of service time
13% K - Number of servers
16% W - Average time in system (response time)
17% RHOHAT - Modified utilization (so that M/M/1 formulas still hold)
19% Copyright (c) 2012-2026, Imperial College London
22% Get M/M/k baseline waiting time
23W_mmk = qsys_mmk(lambda, mu, k);
25% Cosmetatos approximation: adjust M/M/k queue waiting time
26% based on variability factor
28variabilityFactor = (ca^2 + cs^2) / 2;
29Wq = Wq_mmk * variabilityFactor;
32rhohat = W*lambda/(1+W*lambda); % so that M/M/1 formulas still hold