ABSTRACT

Queues frequently appear in game worlds. Sometimes they are obvious—like the queues formed by cars in a traffic jam or patients waiting to see a doctor. M/M/1 queues arise when objects are added to, and removed from, a collection at random time intervals and can be used to model such processes even when the order of the objects is not important. A merchant might buy 50 arrows every Monday but only if he has fewer than 50 arrows in stock. This kind of behavior can be closely approximated by sampling from the distribution for the number of arrows in the merchant’s inventory from the previous Monday and adding 50 if the sample is less than 50. A game might contain many thousands of different types of items that could potentially be found in an inventory, so the question naturally arises as to whether it’s computationally practical to sample from such a large number of queues.