# How to use Tandem Queueing Network Process?

Mathematica provides QueueingNetworkProcess and QueueingProcess. However, I can't seem to figure out how to create a tandem queuing process: whenever a customer arrives, he first needs to go to server 1, then to server 2, then to server 3.

any help is greatly appreciated!

## 1) Using QueueingNetworkProcess to define such a queuing process

With the customer arrival rate arrivalRate and the service rates at each server being serviceRate1, serviceRate2, and serviceRate3, respectively, you can define this queuing process by

g = {arrivalRate, 0, 0};
m = {serviceRate1, serviceRate2, serviceRate3};
r = {{0, 1, 0}, {0, 0, 1}, {0, 0, 0}};
c = {1, 1, 1};

queuingProcess = QueueingNetworkProcess[g, r, m, c];


If you then want to compute the probability of e.g. having one customer at each server you can use:

sDist = StationaryDistribution[queuingProcess];
PDF[sDist, {1, 1, 1}]


To get the performance measures at all three nodes for some numerical values one can use:

Table[QueueProperties[{queuingProcess /. {arrivalRate -> 5., serviceRate1 -> 7.,
serviceRate2 -> 6.5, serviceRate3 -> 8.3}, i}], {i, 3}]


If you want to perform calculations for several different rates, starting with a function like

queuingProcessF[arrivalRate_, {serviceRate1_, serviceRate2_, serviceRate3_}] :=
QueueingNetworkProcess[{arrivalRate, 0, 0}, {{0, 1, 0}, {0, 0, 1}, {0, 0, 0}},
{serviceRate1, serviceRate2, serviceRate3}, {1, 1, 1}]


might be more appropriate, though.

## 2) Using the product of the individual QueueingProcesses

You can define the same queuing process by first defining each individual queue

q1 = QueueingProcess[arrivalRate, serviceRate1];
q2 = QueueingProcess[arrivalRate, serviceRate2];
q3 = QueueingProcess[arrivalRate, serviceRate3];


and then use ProductDistribution to generate the same StationaryDistribution:

sDist2 = ProductDistribution[StationaryDistribution[q1], StationaryDistribution[q2],
StationaryDistribution[q3]];

PDF[sDist2, {1, 1, 1}] == PDF[sDist, {1, 1, 1}]

True

• Karsten, thank you so much! I see all the calculations are related to each queue in the network. What if I wanted to get the network performance? For example, how would I go about calculating the average number of customers in the network or the average network delay? – dark blue Oct 19 '14 at 15:11
• @user21522 The average number of customers in the network is Total @ Table[QueueProperties[{queuingProcess, n}, "MeanSystemSize"], {n, 3}], isn't it. I can't see a way to get the network performance more directly in the moment. – Karsten 7. Oct 19 '14 at 16:08