CS 371 - Introduction to Artificial Intelligence
Homework #4


Due: Thursday 10/24 at the beginning of class.  Participants in the Wednesday night programming contest will have an extension until the end of Friday.
Note: Work is to be done in pairs

Game-Tree Search


All of your classes should be named uniquely so as to not clash in the same namespace with those of other groups.  This is usually accomplished using packages, but for this project, you may simply begin each class name with a unique identifier such as a combination of user names.  In these instructions, your unique identifier will be denoted <uniqueID>.

1. Mancala Utility Function:  Your first task will be to develop an efficiently computable utility function for Mancala.  The one supplied in class TnellerMancalaNode simple subtracts the MIN player score from the MAX player score.  In class, we noticed other possible simple measures of utility that provide additional means of estimating the relative utility of the node.  Develop at least two utility functions and experiment to see which works better.  Don't forget to test it against the one provided as a baseline for comparison.  Name your nodes <uniqueID><#>MancalaNode.java.

2. Alpha-Beta Search:  Your second task can be developed in parallel with the first. Create a new class <uniqueID>AlphaBetaSearcher.java that implements the interface GameTreeSearcher and performs depth-limited minimax with alpha-beta pruning.  You're encouraged to simply modify the provided MinimaxSearcher code, which can be augmented by passing alpha and beta as parameters for pruning.

3. Mancala Player:  Your final task will be to bring your Mancala node utility function together with alpha-beta search and create a real-time Mancala-playing agent.  Name your class <uniqueID>MancalaPlayer and be sure that it implements the MancalaPlayer interface.  Each player will be allotted 2.5 minutes each for decision making.  Supplied in TnellerMancalaPlayer is a very sloppy hack which seeks to adjust search depth according to game progress, which is roughly assessed by (1) the number of pieces still in play, and (2) the number of milliseconds left in the game.  You may use this approach, but be forewarned that there will be better approaches given that (1) with alpha-beta pruning, you can search deeper faster, and (2) my implementation generally has too much spare time at the end of the game.

Your MancalaPlayer will compete against all other MancalaPlayer's to determine the champion of champions.  The champions will receive a mancala game and the respect and awe of their peers and professor. :-)

Todd Neller