# Multiclass M/M/1 queue which can simultaneously have one customer per class

Suppose there is a queue with exponential service time $$\frac{1}{\mu}$$ which accepts customers from K classes with Poisson distribution and rate $$\lambda_k$$ but if a customer from any class arrives at the queue while there is already another customer from the same class either waiting or receiving service, leaves.

I have performed a simulation to find the total service time $$T = W_q + \frac{1}{\mu}$$ but failed.

These are what I have found out from simulations so far:

1. service time $$T_k$$ is diffrent in every class.

2. $$\lambda_k$$ changes while leaving the queue server and becomes $$\lambda_k'=\frac{\lambda_k}{1+\lambda_k*T_k}$$ beacause when one customer arrives and stays in the queue for $$T_k$$, $$\lambda_k*T_k$$ customers arrive and leave immediatly without service. So one out of every $$1+\lambda_k*T_k$$ gets service from the queue, hence $$\lambda_k'=\lambda_k*\frac{1}{1+\lambda_k*T_k}$$.

3. $$\sum_k (\lambda_k'T_k)=(\sum_k \lambda_k')T$$ in which T is the total mean service time of all customers regardless of class.

Update:

So I found out that if we consider this queue as K M/M/1/1 queues with $$T_k$$ service times, this could lead to finding the average number of customers in the system.

The followings are verified by simulation.

Every class has a separate M/M/1/1 queue with service time equal to $$T_k$$ that we are looking for. $$P_0$$ is the probability of each of these queues being empty which is by M/M/1/1 standards:

$$P_0^k = \frac{1}{1+\lambda_kT_k}$$

The average number of customers of K in the system is equal to $$1-P_0^k$$, because every one of them could only have one customer:

$$P_1^k=n_k=\frac{\lambda_kT_k}{1+\lambda_kT_k}$$

The total number of customers in the system is the sum of $$n_k$$:

$$N=\sum_kn_k$$

By this point these are all verified by simulations. After this I tried to find $$T_k$$s and failed. I thought $$T_k$$ should be like this:

$$T_k=(N-n_k+1)*\frac{1}{\mu}$$

or

$$T_k=(1-P_1^k)(N-n_k+1)*\frac{1}{\mu}$$

These have very close results to $$T_k$$s but don't work. I thought that every customer, by entering the queue will have to wait for each one of the customers from other classes be served for $$\frac{1}{\mu}$$ and then be served itself. None of the above work.

Any suggestions?

• I'm having trouble parsing this description. Can you clarify how this is different from $K$ different M/M/1 queues? – Brian Tung Dec 1 '18 at 0:19