MW::SearchAgent Class Reference

Inheritance diagram for MW::SearchAgent:
[legend]
Collaboration diagram for MW::SearchAgent:
[legend]

List of all members.

Public Member Functions

def getAllMoves
def recursiveSearch


Detailed Description

This class has no learning curve, it just evaluates situations
using a search tree.  The algorithm is an analog of minimax,
using adaptations for computational efficiency and the fact
that the game we are playing is not zero-sum

Unfortunately, can't implement abp in this situation because 
the game is not zero-sum; this limitation is discussed more
in the writeup

Member Function Documentation

def MW::SearchAgent::getAllMoves (   self  ) 

With one evaluation of the search tree, this function
determines the moves for each player in the game.
The order of the searching is randomized to ensure that
no player is automatically favored over another based on
his positioning in the player list.

def MW::SearchAgent::recursiveSearch (   self,
  order,
  depth 
)

This is the heart of the search algorithm.  Like most search algorithms
on games, the algorithm tries out a move and then recursively calls the function
to see what happens further down the search tree.  It then undoes the move
and tries another move, eventually picking the move that leads to the best outcome
for the player represented by that level.  The method chooses not to copy the game
and feed it in, instead undoing moves as the function returns; this method is a
more complex and led to some debugging issues but saves time computationally and
memory-wise.


The documentation for this class was generated from the following file:

Generated on Mon Apr 21 22:45:48 2008 for Milks and Wheats by  doxygen 1.5.5