GameAgent API Documentation

class GameAgent: A game agent that, given a GameState, selects a move

getAction(state)
Return an action from state.actions(), where state is a GameState object. Hopefully, it will be a good action.
Two basic GameAgents are provided for you: RandomGameAgent, which selects a move at random, and HumanGameAgent, which prints out the game state in a human-readable fashion and then asks the user which move to select.

 

class UtilityDirectedGameAgent(searcher):
A game agent that chooses the action with highest utility, according to some GameTreeSearcher instance searcher



class GameTreeSearcher:
Exhaustively searches the game tree, returning the best action and its corresponding value.

getBestActionAndValue(state)
Return (action, value), where action is the best action in state.actions(), value is its corresponding utility given optimal play, and state is a GameState object. 
Part of your job will be to implement several GameTreeSearcher subclasses: Minimax, GraphMinimax, AlphaBeta, and GraphAlphaBeta.


class FixedDepthHeuricticGameAgent(searcher, heuristicFn, depth):
A game agent that chooses the action with highest utility, according to some GameTreeSearcher instance searcher, after restricting the search to at most depth ply (moves), where the utilities of states at this depth are estimated using a heuristic evaluation function heuristicFn.  

The evaluation function should take in a GameState state, and return its value for  state.currentPlayer(); you should assume that state will always correspond to a two-player, zero-sum game.

The other part of your job will be implementing heuristic functions for Nim and Othello, and testing the relative effectiveness of various combinations of search strategies and heuristic evaluation functions.