Discrete Event Modeling: Express Lanes

The Situation

Suppose you're the manager of a small grocery store. You have four checkout clerks. The question is whether to institute an express lane (10 items or fewer).

The pros:

The cons:

A reasonable way to make this decision is to use simulation to compare the two scenarios, and use whichever one has the lower mean waiting time (or should it be median?).

How do People Arrive and Leave?

A crucial question in building this model is the arrival rate of customers. Note that we care about how they arrive at the checkout lanes; we don't care at what rate they enter the store. You could look at records in your store, possibly looking at register tapes,

How Many Items Do People Buy?

Another crucial question in building this model is how many items people buy. What kind of source of random numbers shall we use? Gaussian? Do we even use a single source?

How do we determine what distribution to use? We could:

For now, we'll guess that it's a Poisson with mean of 15, but this is just a wild guess. It has no basis in reality at all.

Q: What assumptions would you make in determining this? What distribution or set of distributions would you use? Why? There is no right or wrong answer here; just issues worth considering and discussing.

Examining the Model

For now, we'll explore a model that I built. After this, we'll run it and look at the data, and last, we'll see how it was built. Let's start with what it means.

grocery.mox

Open the model and poke around a little. Consider the following

Running the Simulation

Run the simulation. None of the plotter blocks will automatically open. Let's examine them one at a time:

Adjusting the Model

There are a bunch of fairly arbitrary aspects of this model. The arrival rate, the service time calculation and the number of items distribution, just to name three. I've tried to make plausible choices, but I don't pretend to have done any more than that.

You'll also notice that there's not a lot of randomness in here. The number of items and the arrival rate are random, but not the service time. Do you think it should be?

Another arbitrary decision is the maximum number of items for the express lane. If we increase this maximum, say to 12 or 15, we'd get higher utilization of the express lane, but longer waiting times there (but shorter for the regular lanes).

To do: Choose some aspect of the model to adjust and do this. Run the simulation under these new conditions and see how much of a difference it makes.

Creating the Model

I think the best way to learn how to build a model like this is to do it. You already know how to choose blocks, set their parameters and draw connections, so it's just a matter of getting familiar with these new blocks and their parameters.

To make this exercise worthwhile, notice that we have a model of the store with an express lane, but we don't have a model of our current store, which doesn't have an express lane. To do a proper comparison, we need to have both.

To do: Build a simulation model of the grocery store without an express lane. I suggest you do it mostly from scratch, so that you'll get some practice finding these blocks as well as parameterizing them, but feel free to crib things from this model.

Comparing the Models

To determine whether two variable things are (statistically significantly) different, we should use a statistical test, such as the z-test or the bootstrap, which we'll learn soon.

  1. First, we should choose what data we will collect. In this case, we might use the waiting time, the queue length, the server utilization, or even some combination of those.
  2. We then collect our data. Run each model a number of times, say 30 or more, and collect data from each run. (This is a Monte Carlo experiment.)
  3. Look at the collected data. Compute some summary statistics or construct a histogram. It's important to look at the data to see if anything odd is going on (for example, it's bimodal).
  4. Suppose we want to compare the mean of each sample. If we are willing to assume that the mean is drawn from a Gaussian distribution, we can use the z test.
  5. We'll do that in an upcoming class.

This work is licensed under a Creative Commons License | Creative Commons License | Viewable With Any
Browser | Valid HTML 4.01! | Valid CSS!