# General insight from G/G/m queue approximations

I've been asked to add in some general queue theory insight into some simulation work i've done. Basically, just to include a few lines here and there about what the basic theory would suggest would happen with the queuing system i'm modelling when variables change (specifically the variation in arrival and service rates). I spent a bit of time studying the very basics of queuing theory a couple of years ago, and i've gone back to try and understand it a bit more, but i'm struggling. The queuing system i'm modelling can only be defined as G/G/m - and i'm aware that there are approximation models that can provide insight (though not exact answer). I would be grateful if someone could link me in the direction of some laymen's text I can read/reference and an idea of general points I can make that don't require me basically having to learn everything from scratch.

Since your model is highly general, and since "general queue theory insight" is quite a broad category of observation, you might find here that it is best just to demonstrate some simple monotonicity properties of your simulation model. For example, you could show that your simulated waiting times for the queues tend to be larger when you: (a) increase the frequency of the arrivals in the first $$G$$; (b) increase the length of the use-times in the second $$G$$; or (c) reduce the number of service facilities $$m$$. Those are fairly simple monotonicity properties that occur in queuing models, but they occur in general settings and so it should be simple to get simulation results to this effect irrespective of the particular distribution you use for your inputs.

You might also be interested to note that your model is a special case of a more general $$G/G/m/G/+$$ queuing model examined in O'Neill (2021), which can be simulated easily using the queue function in the utilities package. This latter model/simulation allows you to specify a maximum-waiting-time for each user (which may depend on their place in the queue) and it also allows you to specify some additional restrictions on the service facilities, such as a revival-time for setting up the facility after use, or a closing time for new arrivals or for all service. This paper also shows how you can undertake an optimisation problem for the appropriate number of service facilities, given information on the costs in the problem. This could also be a useful exercise for you to undertake in your own simulations.

Finally, as you point out, there are some approximation models that can tell you about the distribution of certain quantities in queuing problems. There are also some exact models that give distributional results for particular types of input distributions. In a simulation model allowing general arrival times and use-times, it might still be useful to examine what happens when you use a standard case like a Poisson process. This will allow you to compare the results of your simulations with results for this special case.

• Any Python implementations of this more general $G/G/m/G/+$ model available? Commented Aug 20, 2023 at 22:41
• @Galen: The R functions were only programmed in 2021, so I doubt it's been converted to other languages. The paper shows the pseudo-code for the essential part of the procedure (and the rest can be viewed through the function calls in R), so it should be feasible to translate this into Python code and write the related graphical procedures, etc., from scratch. Perhaps a job for an enterprising coder such as yourself?
– Ben
Commented Aug 20, 2023 at 22:48
• For anyone interested, I surveyed some of the available tools in the Python ecosystem. The closest candidates I found in terms of features in utilities are simpy, ciw, and queueing_tool. Commented Oct 21, 2023 at 23:59
• simpy is the most flexible, but you have to build most things yourself. queueing_tool is the least general out-of-the-box (although it can be extended via subclassing), but it has its own interesting feature set focusing on agent behaviour and carrying information tokens through the network. ciw is the closest package (w/o building new features), and primarily lacks the revival time mechanism in comparison to utilities, although it does have scheduling for when the service is open. Commented Oct 21, 2023 at 23:59
• @Galen: Thanks for undertaking that work. As a general rule, the more you generalise the further you push towards the general form of Discrete Event Simulation (DES) models, so there is some trade-off between generality and simplicity. The aim of the queue function in the utilities package is to give a fairly general queuing model with no need for the user to build up the underlying events.
– Ben
Commented Oct 22, 2023 at 0:12