CMSC 433 - Project 2: Coffee Shop Simulation

PDF of design statement and progress report due by 23:59:59 on Thursday, March 28th for 10% of project grade.
Code submission due by 23:59:59 on Monday, April 1st for 90% of project grade.

Project Overview

You will write a simulation for a coffee shop. The simulation has five parameters: the number of customers (diners) that wish to enter the coffee shop; the number of tables in the coffee shop (note: there can only be as many customers inside the coffee shop as there are tables at any one time - other customers must wait for a free table before going into the shop and placing their order); the number of cooks in the kitchen that fill orders; the capacity of machines in the kitchen used for producing food; and a flag as to whether everyone has the same order or not.

Customers in the coffee shop place their orders (a list of food items) when they enter the coffee shop. These orders are then handled by available cooks. Each cook handles one order at a time. A cook handles an order by using machines to cook the food items. There will be one machine for each kind of food item. Each machine produces food items in parallel (for different orders, or even the same order) up to their stated capacity.

Our particular coffee shop will only have three food items, each made by a single machine: a burger, made by machine Grill, which takes 500 ms to make; fries, made by machine Fryer, which take 350ms to make; and a coffee, made by machine CoffeeMaker2000, which takes 100 ms to make.


General Requirements

Much of the design of the simulation will be up to you. You will need to provide a design statement and progress report as a PDF, uploaded to the submit server directly as a PDF (not via Eclipse). We do, of course, have some specific requirements.

First, you must not use concurrent collections in any part of your simulation. You can and will use things like synchronized or ReentrantLock or Future or calls to wait, notify, and notifyAll or Semaphore or CountdownLatch objects. You cannot use things like BlockingQueues, etc.

Second, you must use the following classes and the methods specified for them (most of which is what you'll be writing). All of these are available in the skeleton code. You may implement any other methods you need for these classes. You can also implement additional private classes or new helper public classes as needed (just make sure they are in the same folder/package as the rest of the project files).

* The starred classes are provided for you, and must not be changed; the remaining classes can be changed within the bounds given below.


Particulars


Getting Started

First, familiarize yourself with the above requirements in general. Next, check out the project starter files from your CVS repository. After getting the source code, review the requirements while looking at the skeleton code. You will be writing helper methods, etc. so the skeleton files are just a starting point.


Your Design Statement and Progress Report

By 23:59:59 on Thursday, March 28th you will need to submit a document explaining the strategies you are using to approach the project goals. Discuss where you are planning on making use of things like wait and notify and Future tasks. Your plans might change as you continue to work on the project, but by March 28th you need to be far along in your design stage (and hopefully well enough into your implementation) to be able to discuss your plans and report on where things stand in terms of progress towards completion of the simulation part of the project. This statement should reflect how your design satisfies the validation criteria, particularly in its use of synchronization and ability to have concurrent activities. Remember, there is also a verification part to the project. You do not need to discuss that part of the poject in this document. The document must be submitted as a PDF (if you don't have a virtual PDF printer on your Windows machine, CutePDF is available for free online - OS X has PDF printing built in).


Testing Your Code

We have allowed a fair amount of freedom in the design of your classes for this project. Because of this freedom, and the nature of the submit server, constructing generic unit-level tests poses a problem. In particular, we've allowed you to modify the constructors of many objects (such as Machine and Customer), and unit tests would not work on modified objects since the pre-written tests wouldn't know things like what to pass into the constructor. Therefore, you might have to take on a fair bit more responsibility for your own tests as you work on this project. We've set up some preliminary public tests that will give you a sense of whether you are on the right track, but once the project deadline has passed and we're ready to do full grading, we will test your code with our own validators, and possibly with manual command line testing, to check a variety of simulation characteristics. If you honestly pass the public tests (that is, you didn't work out some way to trick our auto-validator) then you'll receive up to 40 points for this public tests (depending upon how many of them you passed). The post-due-date testing will include performing multiple test runs on the public scenarios as well as other scenarios to check that none of them fail (where with the way the submit server works, if a public test passes on some run, it will count for public test points).

In order to test your code with our own validator, we have asked you to place all simulation code into a method Simulation.runSimulation() which returns a List of SimulationEvent objects which we can then pass directly to things like the Validate.validateSimulation() method.

The tests labelled as public tests on the submit server will test some scenarios with different numbers of cooks, customers, etc. As mentioned above, a significant portion of the grading for this project will be done after your final version is submitted via "hand grading" of certain things due to the concurrent nature of the project.


What to Turn In

Every file you submit should have your name and UID. To enforce academic integrity, Code will be checked for similarity to other submissions. Each student should make his or her own individual submission. Use Eclipse to submit your project.

Due to the non-deterministic nature of multi-threaded code, a portion of your project grade will come from manual inspection of your code, and since there are many approaches, our understanding will be guided by your description. Therefore, it is in your best interest to provide a sufficient amount of detail in your comments order to reduce the chance for misinterpretation.




Web Accessibility