CPSC 531: Systems Modeling and Simulation

Professor Carey Williamson

Fall 2017

Assignment 3: Weasley Barber Shop (40 marks)

Due: Friday, November 10, 2017 (4:00pm)

Learning Objectives

The purpose of this assignment is to learn about discrete-event simulation, multi-server systems, loss models, and Markov chains.

Background

The Weasley twins, Fred and George, have opened a new barber shop at Hogwarts. Their shop has two barber chairs for customers to sit in while getting their hair cut, either by Fred (chair 1) or George (chair 2). There are also 3 regular chairs in the waiting room for customers who are waiting for service, in a First-Come-First-Serve fashion.

Customers arrive to the barber shop according to an open-loop continuous-time Poisson process with average rate lambda. If both barber chairs are empty upon arrival, arriving customers choose their barber uniformly at random (since they can't tell the twins apart). If only one barber chair is empty, the customer moves to that chair. If both barber chairs are occupied, then the arriving customer moves to the waiting room, if space is available. If the waiting room is full, the customer leaves in a huff and never returns. If there are waiting customers, they receive service by the next available barber as soon as a barber chair is vacated. The service time for a haircut is exponentially distributed. However, Fred is slightly faster than George at cutting hair. Their respective service rates are mu1 and mu2, with mu1 > mu2.

Technical Requirements

Write a discrete-event simulation (in C, C++, or Java) of the Weasley Barber Shop, using a continuous-time model. Then do the following:

  1. Use your simulation to determine the proportion of lost customers when lambda = 4.0, mu1 = 3.0, and mu2 = 2.0.
  2. Conduct a one-factor simulation experiment varying the waiting room size to see the effect on the loss of customers at high load (i.e., 80% or more).
  3. Use your simulation to compare your results to those for an M/M/2 queue, where the servers have homogeneous rates mu1 = mu2. Comment on your results.
  4. Use your simulation to compare your results to those for an M/M/1/K queue, where the single server has an aggregate service rate of mu1 + mu2. Comment on your results.

When you are finished, please submit your solution in electronic form to your TA. Your submission should include the source code for your simulation program, a brief user manual describing how to compile and use your simulator, and a description of the results generated using your program. Please remember that assignments are to be done individually, and submitted to your TA on or before the stated deadline. The penalty for late submissions is 4 marks per day (or portion thereof) beyond the deadline.

Grading Rubric

The grading scheme for the assignment is as follows:

Up to 4 bonus marks will be awarded for an analytical solution (using Markov chains) for the Weasley Barber Shop, which can be used to validate your simulation model.

Tips