Skip to Main Content
Game AI Pro 2
book

Game AI Pro 2

by Steven Rabin
April 2015
Beginner content levelBeginner
577 pages
17h 58m
English
A K Peters/CRC Press
Content preview from Game AI Pro 2

37

Using Queues to Model a Merchant’s Inventory

John Manslow

37.1 Introduction

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. At other times, they are more difficult to identify—like the queues formed by items in the inventory of a merchant. 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.

This chapter will describe how to use the statistical properties of M/M/1 queues to efficiently simulate how they change over time. To provide a practical example, the chapter will show how to represent the inventory ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Game AI Pro 3

Game AI Pro 3

Steve Rabin
Game AI Pro

Game AI Pro

Steven Rabin

Publisher Resources

ISBN: 9781482254792