CompSci 108
Fall 2008
Software Design and Implementation

Designing a Robot Simulator

Form groups of two or three You should write down the group's solution as you go so that it can be compared with others' solutions.

This project is intended to get you to try to design a program without worrying about exactly how it will be implemented. In other words, you should explore a design in enough detail to convincingly answer the questions below without writing any actual code.

Specification

You should design a program to simulate the operation of a Lunar Mining Factory at which ore and other precious metals are packaged into boxes for export to other worlds. The boxes are transported by rocket, robots are used to move the boxes from the factory to the rocket. When the robots are done unloading their boxes, they carry supplies from the rocket back to the factory. Rockets land on special landing pads near the factory they serve.

A robot unloads a box at a rocket, picks up a box of supplies if available, then heads back to its factory. At the factory a robot unloads its cargo, loads another box, and heads to a rocket. Robots may have to wait at the factory until a box they can carry becomes available. Robots are loaded with a box on a first come, first served basis. As soon as a box is ready, it is put on the first robot that can handle the box. It takes time to load and unload boxes depending on the box's characteristics. Robots unload boxes in the order at which they arrive at a rocket. Boxes are filled by each factory at a fairly consistent schedule.

There are various kinds of boxes (e.g., big, small, purple, green, perishable, flammable, light, heavy, etc.). Some robots can carry all boxes, other robots can only carry certain kinds of boxes. Robots also move at different speeds depending on what kind of motor the robot has. Your simulation should be able to handle any number of lunar factories, any number of rockets serving each factory, and any number of robots moving between the two.

Your simulation should have at least two visible components, i.e., displaying all robots as moving entities between rockets and factories and displaying a history of factory's productivity.

Use Cases

Test your design against the following scenarios by role playing or drawing an interaction diagram for each:

Change cases

Once you have tried your design on each of the use cases above and feel confident it works properly, incorporate the following additions and document the changes necessary to your design. In particular, how many classes/methods need to changed/added to add the following: