Costco Time Markov Chains

Cars arrive at the Costco gas station at rate \(\lambda=1\) car per minute.

Part 1

Let \(X_i(t)\) denote the number of customers in queue \(i=1,\ldots,6\) at time \(t\), including any customers in service at the corresponding pumps. The process \(X(t)=(X_1(t), \ldots, X_6(t))\) is a vector-valued continuous time Markov chain. Let \(S(t) = X_1(t) + \cdots + X_6(t)\) denote the total number of customers in the system at time \(t\), including any customers in service.

Write a program to simulate the customer arrivals and services and the values of \(X_i(t)\) over a long time period, say a week. You will use your simulation results to approximate the following items, so consider all parts below when designing your code.

  • The long run distribution of the number of cars in the system (waiting or in service).
  • The long run fraction of time there are no cars in the system.
  • The long run average number of customers in the system.
  • Any other features of the long run distribution of the number of cars in the system you’re interested in
  • The long run distribution of the amount of time a customer spends in the system (waiting time + service time). (This will require more work than just finding the number of customers in the system. You will need to track individual customers from the time they enter until the time they leave.)
  • The average time a customer spends in the system.
  • Any other features of the long run distribution of the amount of time a customer spends in the system you’re interested in

Hints:

  • Consider a simplified version of the problem first. For example, what if there’s only one pump, one line, and one customer type?
  • Rely on properties of Exponential race/Poisson thinning as much as possible.

Part 2.

Change some features of the set up and investigate how your changes effect the average number of customers in the system, and the average time a customer spends in the system. There are lots of things you can do. Here are just a few suggestions, but I encourage you to be creative!

  • Change the parameters \(\lambda\), \(\mu\), or the distribution of customer types. Maybe each pump has its own service rate.
  • Change the layout of the station, say still 12 pumps but arranged 4x3 instead of 6x2.
  • Have all the cars wait in a single line, or two lines (based on type, with one type joining either line)
  • Assume that if each queue reaches a certain length, any arriving cars will just leave. Or assume that an arriving car only joins a queue with some probability that decreases the longer the line is.
  • Change arrival or service times to something other than Exponential, but note that this makes the problem significantly harder because you can’t rely on the memoryless property anymore.