AiS Challenge 2003 STI :: Coffee Shop Service Simulation

  1. Real Problem: To assess the impact (cost and benefits) on service of different staffing strategies at a high-volume coffee shop.

  2. Working Problem: We will examine a simplified version of the problem, with the following characteristics:

    Using the above assumptions, we will simulate the effectiveness of different staffing levels in meeting the standard service policy.

  3. Mathematical Model: When arrivals into a queuing system are independent (i.e. the fact that a person or party enters the shop during a given minute has no effect on whether another party enters the shop during any other minute), the arrival process is said to be a Poisson process, and the time between arrivals is a random variable which follows the Exponential distribution. This distribution is described by the following probability distribution function:

    f(t) = λe-λt
    1/λ = average interarrival time

    The same distribution will be used for the service time (the time from the moment the customer's order is taken to the moment the order is filled), but it is customary to employ μ (instead of λ) for the service rate:

    f(t) = μe-μt
    1/μ = average time to service an order
  4. Computational Model: There are many ways to implement a Monte Carlo simulation of the working problem described above. Almost all general purpose programming languages (e.g. C/C++, Java, BASIC, FORTRAN), as well as a number of commonly-used scripting languages (e.g. Javascript, VBScript) and application-hosted languages (e.g. Excel with VBA) can be used successfully. (There are special-purposes languages as well, specifically designed for such simulations; we will not be using any of these.) The usual approach is to program the simulation as a "discrete event simulation", where a variable is used to keep track of the current simulation "clock", and a pseudo-random number generator is used to calculate the times of the upcoming simulation events (e.g. customer arrival, completion of an order for one of the customers currently being served). At each iteration of the simulation, the clock is advanced to the time of the earliest upcoming event, the simulated statistics (e.g. average waiting line length, average waiting time, etc.) are updated, and the simulation state is modified as necessary (e.g. length of the waiting line increased by one when a customer arrives).

    Most general-purpose programming languages provide variations on a very simple pseudo-random number generator, which generates numbers from the Uniform distribution, on the interval [0,1). Since our simulation will need to generate numbers from the Exponential distribution, we will need to transform the numbers returned from the Uniform distribution, as follows:

    tarrival = -ln(1-uarrival) / λ
    tservice = -ln(1-uservice) / μ
    uarrival = number in interval [0,1), returned from uniform pseudo-random number generator, for arrival time
    uservice = number in interval [0,1), returned from uniform pseudo-random number generator, for service time

    An example of a similar Monte Carlo simulation, but based on a process with a number of servers in series, can be viewed here. This example is constructed entirely in Javascript; because it relies extensively on Dynamic HTML for displaying the results during the simulation, Internet Explorer v5.5 or higher is required.

  5. Results/Conclusions: We will perform "what if" scenario analysis of different staffing levels, to find the minimal level which satisfies (based on the simulation results) the standard service policy. If time permits, we will also examine the impact of relaxing or tightening the tolerance included in the service policy (e.g. changing the "95% of all customers" portion of the rule to 90% or 99%).