CSCI 136 - Fall 2019

Data Structures & Advanced Programming

Home | Bill's Lectures | Sam's Lectures | Labs | Handouts & Problem Sets | Links | CS@Williams

Lab 8: Queuing Simulation

The assignment this week is to complete 13.7 Laboratory: Simulating Business from Bailey pg. 341. In prior labs we have developed programs to process data or solve problems using the data structures and programming concepts we discussed in lecture. This week, we will explore the ways that data structures appear in the physical world, comparing two scenarios:

We will build a simulation for both scenarios and then measure the performance of each approach.

Important note: This week you may again work with a partner.

Pre-lab: Step 0

Before lab, please do the following:

Lab Assignment

Instructions for this assignment can be found on pages 341--342 in Bailey. We have posted some suggestions below. We have also posted a sample abstract base class (BusinessSimulation.java) to help you design your program to simulate the two scenarios as well as a simple customer object (Customer.java) to get you started.

We would like you extend the abstract base BusinessSimulation class with two concrete classes, say OneQueue.java and MultiQueue.java. You should implement functionality common to the single-queue and multiple-queue simulations in the abstract base class.

Suggestions:

You should have a well-organized, well-commented program that simulates the two scenarios described above.

Thought questions

Please answer thought questions 1--4, and place your answers in the PROBLEMS.md file. Some notes:

Lab Deliverables

For this lab, please submit the following:

As in all labs, you will be graded on design, documentation, style, and correctness. Be sure to document your program with appropriate comments, including your name and a general description at the top of the file, a description of each method with pre- and post-conditions where appropriate. Also use comments and descriptive variable names to clarify sections of the code which may not be clear to someone trying to understand it.

Submitting Your Lab

As you complete various milestones, you should commit your changes and push them. Commit early and often. When the deadline arrives, we will retrieve the latest version of your code. If you are confident that you are done, please include "Lab Submission" as the commit message for your final commit. If you later decide that you have more edits to make, it is OK. We will look at the latest commit before the deadline.

We will know that the files are yours because they are in your git repository. Do not include identifying information in the code that you submit. Our goal is to grade the programs anonymously to avoid any bias. However, in your README.md file, please cite any sources of inspiration or collaboration (e.g., conversations with classmates). We take the honor code very seriously, and so should you. Please include the statement "I am the sole author of the work in this repository" in the comments at the top each of your java files.