AIPlayer

AIPlayer is an abstract class to be subclassed for all of the AI. It will know the number of players in the game, have a Perspective which privatizes the hidden aspects of the game from this player, and a List that tracks the player’s estimates of their current game position.

Perspective

A Perspective is a wrapper around a GameIterator_ and an int which is the current player’s index in the game cycle. An AIPlayer can ask the Perspective for their view of the game through the GetPrivateGame_ method. This will return a Tuple of a CardGame and GameIterator, where all the private Card information hidden from this player is shuffled and replaced.

MakeAction

The MakeAction method is the critical method that needs to be overridden in any subclass of AIPlayer. When a choice is found in the game, the number of potential moves will be passed in. The AIPlayer is expected to return an int which is the index of their chosen move.

If your AIPlayer is being used in the Heuristics portion of CardStock, then within MakeAction, you should also create an array of doubles with the estimated inverse rank of the player for each possible move and pass this to RecordHeuristics for processing.