CS 261 Homework 6 - Space Port Simulator

Due Wed Apr 24 at 11:59pm

Overview

In this assignment, you will be able to practice and experiment with implementing HashMaps, looking at the effects of different hashing algorithms and techniques for dealing with collisions.

But in an attempt to make things a little more interesting, you'll be using an implemented HashMap to model the underlying engine of a program that simulates a Intergalactic Space Port! Your SpacePort will function as a ship valet service: spaceships will arrive at your port, you will dock them in your port, and then later retrieve them for the pilots. Your port will charge pilots based on how long they stay docked. Your port is basically a HashTable, which is good because pilots are impatient folk (they feel the need--the need for speed) and you promise them a price discount based on how long it takes to takes to park and retrieve their vehicle. In addition, your SpacePort will be charged for each "collision" that occurs when parking the vehicles (you have to pay for damages). Finally, there is a cost associated with the amount of space required for your spaceport--your parking garage is on prime galactic real estate.

By the end of this assignment, you will have implemented a few variations of HashMaps, in order to support a working simulation. Computer simulations are a common and useful kind of program, and are particularly good at demonstrating why efficient code and data structures are helpful!

This assignment should be completed individually. Note that this assignment is intentionally written to be both straightforward and somewhat vague. Implementing different HashMaps should be pretty clear (you are welcome to adapt code from lecture or from the book). However, what you do with the simulation is up to you: feel free to be creative! Take ownership of your own programming! If you have questions or ideas I'm happy to discuss them, but you should be able to start adding ideas and functionality on your own!

Objectives

Necessary Files

You will want a copy of the Hwk6.zip file which contains a pile of classes to help get you started. Since the goal of this assignment is primarily to play with HashMaps, I've provided a lot of supporting code to let you hit the ground running. These classes include:

Be sure to look over all of these classes carefully, and feel free to modify them as needed to support your simulation (though be sure to include notes about what you modify in your README!)

I have also included a small file listing random spaceships for your simulation to use (ships.txt). I've also included the grammar file used to produce this list of random ships via the RandomSentenceGenerator from the last homework (spaceship_grammar.txt); this should demonstrate how useful the previous assignment was, and you can use the grammar to make longer lists of random SpaceShips (you can also of course modify the grammar if you wish to make more interesting/varied cargoes).

Last but not least, the zip contains the README for the assignment, which you will need to fill out!

Details

There are basically two pieces to this assignment. The first part involves implementing SpacePorts (i.e., HashMaps) to form the basis of your simulation. The second (smaller) part involves adapting and customizing the provided simulation to make it more detailed, interesting, or otherwise logical.

The SpacePort

The Simulation

Submitting

BEFORE YOU SUBMIT: make sure your code is fully documented and functional! If your code doesn't run, I can't give you credit!

Also make sure you that have filled out the README.txt! There are actually some questions of note here that you will need to answer.

Submit your program to the Hwk6 submission folder on hedwig, following the instructions detailed in Lab A. You should upload all you classes, as well as the README.txt.

The homework is due at midnight on Wed Apr 24.

Extensions

The simulation advancements themselves are a kind of extension. Nevertheless, there are a few "above and beyond" things you might consider (and may earn extra credit for):

Grading

This assignment will be graded based on approximately the following criteria: