Algorithm
Development Kit 1.0

algs.model.gametree
Interface IPlayer

All Known Implementing Classes:
IntelligentAgent, Player, RandomPlayer

public interface IPlayer

A Player of the game.

Each player has a scoring method that can be used to evaluate a given game state. For human players, the scoring function is used when the human plays against a computer opponent. Specifically, when the algorithm tries to identify the best move that the player might make, the evaluation function tells what that best move is to be.

Since:
1.0
Version:
1.0, 6/15/08
Author:
George Heineman

Method Summary
 int eval(IGameState state)
          Return the evaluation of this game state from player's perspective.
 void score(IGameScore score)
          Set the scoring method used by player on the game state.
 java.util.Collection<IGameMove> validMoves(IGameState state)
          Return the player's valid moves given the game state.
 

Method Detail

validMoves

java.util.Collection<IGameMove> validMoves(IGameState state)
Return the player's valid moves given the game state.

If no moves are available, returns an empty Collection, not null.

Parameters:
state - game state from which player is to make moves.

eval

int eval(IGameState state)
Return the evaluation of this game state from player's perspective.

Parameters:
state - The game state

score

void score(IGameScore score)
Set the scoring method used by player on the game state.


Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.