Designing a Robot Simulator


Pair up with another student near you. Start this activity by introducing yourself to your partner if you have not already met each other. You should write down your group's solution as you go so that it can be compared with and defended against others' solutions.

This project has two goals: to design a program without worrying about exactly how it will be implemented; and to defend your design decisions to others in the class. In other words, explore your design in enough detail to convincingly answer the questions below without writing any actual implementation code (header files, javadoc, or CRC cards should be sufficient to resolve specific issues).

Specification

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 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. All robots can carry supply boxes from the rocket to the factory. 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.

Validating your Design: Use Cases

Demonstrate your design using the following scenarios by showing how each class, or package of classes, interacts with each other. When two classes interact, it should be clear how they know about each other (i.e., instance variables in the same class, passed as a parameter, etc.) and what information is needed to specify the interaction (i.e., position to go to, size to create, etc.).

Defending your Design: Share and Compare

After you have verified your design on the use cases above and feel confident it is as simple and flexible as you want, pair up with another group and share your designs. Where your designs differ, each group should take turns defending their design decision before ultimately settling on a new design. For each difference, describe the pros and cons discussed for each approach and why the new design is stronger than the original. Eventually, your group of four should settle on a single design, verify it again using the scenarios above, and everyone in the group should feel comfortable defending the design.

Next, pair up with another group of four and share your designs again. Resolve your differences as above, making sure to keep a log of your discussion again. Eventually, each member of your group of eight should each feel comfortable defending the design.

Finally, present your completed design to the other groups in class.


Comments?