This assignment is due on Monday, March 3.
(a) Code up Alex Thornton's Project #5 from ICS 22, available on the web at http://www.ics.uci.edu/~thornton/ics22/LabManual/GoneToTheMovies/. This project lets you write a simulator of people standing in line at a movie theater. This is a specific instance of a situation that comes up frequently, not just in the real world but also in computer systems. Computer networks, in particular, consist in some sense of client requests (like your browser requesting a web page or your computer sending a document to a shared printer) and servers satisfying them. When the server can't satisfy each request immediately, the waiting requests are typically queued up. Determining the overall performance of a network (how long do requests have to wait, how many can be satisfied per minute) is a crucial task, since decisions about the size and number of servers and the necessary bandwidth depend on that analysis (and on a more practical level, if your web site makes visitors wait annoyingly and your competitor's site serves them quickly, your competitor will receive more traffic, be more successful, and have a better chance of being bought out for $100 million by AOL).
This project analyzes the performance of a queueing system experimentally, by simulating it. Queueing system performance can also be analyzed mathematically, which is the focus of a subdiscipline of computer science called queueing theory. Take just a second to reflect on the differences between experimental and mathematical analysis: What are the advantages and disadvantages of each?
Of course you must test your code thoroughly, but you are not required to use JUnit.
There are more design decisions for you to make in this program than in the previous ones. It's a wise idea to attend section early in the project, to discuss various approaches and make sure you're on the right track.
(b) For a little extra credit, make your simulation more realistic by accommodating some variability. But before you start, save a completed, correct copy of your required version and make any extra credit enhancements on a fresh copy. You'll turn in the required and extra credit versions separately.
We all know that not every transaction (at a ticket window, in the supermarket, or on the Web) takes the same amount of time. Instead, there's a range.
Change your program so that instead of a fixed transaction time for each window, the user can specify a minimum and a maximum transaction time, with the program choosing a value at random from that range. (Look up java.util.Random.)
You could also generate customers at random for an even more realistic simulation.
(c) Continue to think about your optional GUI-building project, part (d) of the Sixth Homework. It will be due in about a week and a half. You may build a GUI onto the movie theater simulator if you like.
What to turn in: Turn in your Java files via Checkmate.
Written by David G. Kay, Winter 2003, to build on Alex Thornton's "Gone to the Movies," an ICS 22 project.