COMP 303 Software Development - Fall 2011: Milestone 3


Due: 18:00, Sunday, December 4, 2011
In this milestone you will add further non-trivial features to your game code. Like milestone 2, this assumes you have a satisfactory code-base from your efforts on the previous milestone. If you need help improving your code to reach an appropriate level, please see a TA or the instructor.

Requirements

  1. Many implementations of Mahjong will provide some form of automatic play, for instruction, as part of a hint system, or just as amusement. Such "artificial intelligence" (AI) can be simple or complex. Here you need to implement and incorporate into your game 3 different forms of AI player:
    1. Simple AI. This AI should choose matches randomly from all available matches at each point in the game.
    2. Normal AI: This AI should offer an improved play over the simple AI, by using a strategy that selects more intelligently from the list of all available matches at each point in the game.
    3. Cheating AI: This AI should improve over the normal AI. It does so by being able to see tiles that are currently hidden and using that extra information to make better choices.
  2. An interface needs to be provided to start any of the 3 AIs at any point during gameplay. Once started, there should also be some way to terminate the AI and resume manual gameplay.
  3. Starting an AI on a game disallows use of the results in the high-score list, although the timer should still run. Save/load should be inhibited while the AI is active, but pause/continue should still work.
  4. AI activity should be displayed; pair-selection and removal should be highlighted and shown with some delay so it is clear what is happening.
  5. To fully validate your AIs, you will also need to implement a non-GUI batch mode. To do this add a new command line parameter: "-batch [simple|normal|cheating] [random|solvable] n". Specifying this parameter prevents the construction of the normal GUI, and runs the specified AI on n random boards (purely random construction or solvable) as fast as possible. Textual output should then report the number of times the AI solved and did not fully solve the board.
  6. All code must be well documented, including javadoc and internal comments as appropriate.
  7. You must incorporate (extensive) unit testing into your project. All important game behaviour and all significant methods should have associated unit tests based on JUnit. All tests must be linked from a class named Milestone3Test.java to make it easy to run all of them as a single suite.

What to hand in

You should hand in one archive-file and one document per group. Recall we are using moodle to handle the submissions.
  1. An exported project in a zip or tar.gz file. This must include all files necessary to build and run your project, as well as all javadoc output. Please include your group number in the archive filename.
  2. A 1--3 page document describing your design. This should include components:
    1. a textual description of your Normal and Cheating AI strategies, and a discussion of how they are able to surely improve over the Simple and Normal AI respectively.
    2. four bar-charts comparing AI success. Each chart should have 3 bars showing number of successful solves when executed on at least 100 random boards. Two bar-charts show results with random board construction on the turtle and ziggurat boards, and the other charts shows results from solvable board constructions on the two layouts. Note that this evaluation is separate from normal unit testing.
    3. a brief description of the specific contributions of each group member.
    4. Note: All documents should be provided using only common, OS-neutral format(s): pdf or ASCII text for textual documents, and pdf, png, gif, or jpg for images.

Evaluation

This milestone is worth 35% of the project component of your course grade. Grading will take the following into account:
  1. Code is well documented, clear and uniformly structured.
  2. Code provides the functionality listed above.
  3. The AI design is reasonable and testing shows differences between the 3 designs.
  4. Code is correct and does not exhibit bugs or other failures. Note we may apply tests of our devising (ie outside of your unit tests).
  5. Code is well-designed following the principles discussed in class.
  6. Unit tests provide extensive and relevant coverage of potential bugs and problems.
  7. The document supplied includes all components, correctly and cleanly expressed.
Note that all team members are expected to contribute in some fashion to all milestones. Your contribution to each milestone may be somewhat uneven, but your final project grade will be scaled according to your overall contribution throughout all the milestones.

Completing the Project

Completion of the 3 milestones gives a base project grade (out of 95%). As emphasized in each milestone, your individual grade for the project will be scaled up or down according to the extent of your individual contribution. This will be assessed partly from the information provided in each milestone. To help ensure a fair evaluation, each group must also participate in a brief discussion of your project with the instructor, done during class-time in the last two classes of the term (December 5 and 6). Showing up for this meeting gives you (individually) the remaining 5% of the project grade. A specific schedule for these discussions will be posted in moodle.