Assignment 01-S98
Monopoly Simulation Project
Topics and Concepts: Group work on a relatively large project -- including definition of group and individual responsibilities and the importance of regular communi-cation; use of state transition diagrams to model the behavior of a program system; thorough and precise definitions of component interfaces; use of electronic communication media (e-mail, phone, ftp, etc.); data driven analysis, decomposition, and design of a larger project; separate component and integration testing; incremental programming (or programming by iterative enhancement); inheritance, virtual and pure virtual functions.
Project: You are to write a simulator for the game of monopoly. The simulator should work for any number of players from 2 to 8 to be chosen by the user. You are to omit all details concerning the exchange of money, except, perhaps, for the purchase of property and payment of rent. Furthermore:
I will provide you with some project milestones. We will attempt to solve this problem one step at a time. Considerable planning and a commitment to documentation and verbal and written communication will be required if you expect to complete this project in a timely manner. You will find it useful to first carefully analyze the problem specification (Monopoly Game Rules) and then work on the structural design of your simulator. Only after this has been done should you even begin to think about the C++ implementation.
Phase 1 -- Problem Analysis: (Due date to be specified later)
In building the simulator, we will work hard on identifying the problem domain entities that might be modeled, and in defining for inclusion in the model the essential characteristics of and operations on these entities. Here is how this might be done ...
Your team should meet as soon as possible and begin reading through and studying the Rules of the game. I strongly urge you to actually PLAY the game as part of your analysis. Below is a list of some of the written outcomes (documentation to be produced) of your analysis effort.
An initial list of entities and entity attributes probably can be formulated without playing the game. However, the development of the state transition diagram for an object class and the list of operations required on each entity may be pretty difficult to construct without experience in playing the game and documenting the operations and state transitions as they occur.
Some other issues:
To Be Turned In: 1) List of problem domain entities each with a detailed list of attributes and operations. These lists should be entered on the computer using either a word processor or a simple editor. 2) Complete state transition diagrams for a player. Again -- I will try to provide examples before you start putting anything on paper.
STOP HERE -- UNTIL FURTHER NOTICE
Phase 2: Simulator DesignIn defining the primary components of your simulator, the main focus should be on the data type models constructed as part of Phase 1. At this point your group should begin to think about partitioning set of all of these components into 3 subsets, and allocating each subset to a member of the group. The game should be replayed again, at least in part, with each member of the group responsible for adding to and refining the attributes and operations for the entities type models assigned to him or her.
You might consider dividing up your type models work as follows:
Additional type models you may wish to divide up include the representation of the dice, houses and hotels, the bank, etc. You may also want to charge one member of the group with implementing a user-friendly graphical interface for your simulator (perhaps even with a few sounds). This should be deferred until at least some part of your simulator is working and ALL OF YOU have had a to discuss what you want implemented and how it will be done.
At this point, the group needs to begin to map out a description of the responsibilities of each member to the others.
The mapping of each entity model to a C++ class can now begin.
You may well have just three public methods for each type, a constructor (with appropriate initialization), destructor, and an "action" operator. There may be many other functions defined, but these will be private to the class (called by the "action" function)
NOTE: Chapters 12 and 14 of the Friedman/Koffman text contain some small examples illustrating how some of the above information might be documented. It is advisable to automate these lists so that they can be updated as needed and e-mail to your group members and/or printed. All three team members should try to adopt a similar format for describing his/her types.)
To Be Turned In: Complete printouts of the documentation provided for items 1) - 4) listed above.
Phase 3 - Component Implementation and Testing:
Each member of your group team is responsible for implementing, compiling, and testing the classes designed in Phase 2. Each member of the team should test a class that someone else designed. I will not insist on this, but it might be an useful exercise. To test your class, you will need to write a special driver program to test the constructor and all other functions of the class. You should also update the lists from Phase 2 and star (use an asterisk, *) any changes in these lists.
NOTE: You should NOT try to code any class all at one time. Rather begin by coding a small "nucleus" of attributes and methods. Get these compiled and tested, and then incrementally add more attributes and methods and test these. Repeat this process until you have a complete class as described in your Phase 2 lists. You may even wish to complete Phase 4 (below) before adding additional features to your components.
To Be Turned In: Your driver programs, the code for each class implemented, and your revised lists from Phase 2.
Phase 4: Integration Testing
Integrate all components developed in Phases 1-3 into a single program and complete the code for and test this program. You should keep a log of ALL major problems encountered during integration. Turn in your final code, your log, and a reasonably informative trace of the execution of your program for perhaps the first 100 player moves.
To Be Turned In: The output from your system integration test and your Problem Log. A "live" demonstration of your simulator in action would be appreciated.
Phase 5: System Enhancements (as time permits)
Review your list of not-yet-implemented features and repeat Phases 2-4 for each of these features, enhancing the relevant models and classes, implementing the enhancements, and finally repeating the integration testing step outlined earlier.
To Be Turned In: The output from your system integration test and your Problem Log. A "live" demonstration of your simulator in action would be appreciated.