CS 371 - Introduction to Artificial Intelligence
Homework #4

Due at the beginning of class 12
Note: Work is to be done in pairs, and submitted via email attachment. 

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 ScoreDiffMancalaNode simply 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.  Your implementation should outperform that of the supplied utility function.

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 copy the provided MinimaxSearcher code to your AlphaBeta code as a starting point.  Then augment the code 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 SimpleMancalaPlayer 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 implementation should outperform the supplied example implementations.

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. :-)

FairKalah: Note that the default constructor will create a standard initial Mancala board state. If you use the constructor that takes a state index 0-253, you'll get a different board state with the same number of total pieces. These are "FairKalah" board states we've discovered as fair, i.e. two optimal players will draw the game. (If you supply a constructor state index outside the numeric range 0-253, a random fair initial state from those 254 will be selected.)

Todd Neller