Algorithm
Development Kit 1.0

algs.model.gametree
Interface IGameScore

All Known Implementing Classes:
BoardEvaluation, DefaultEvaluation

public interface IGameScore

Each game state position requires some scoring function.

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

Method Summary
 int score(IGameState state, IPlayer player)
          Method to evaluate a game state from a player's perspective.
 

Method Detail

score

int score(IGameState state,
          IPlayer player)
Method to evaluate a game state from a player's perspective.

Intended to enable scoring functions from being designed separately from the specific representation of a game. Higher scores are more favorable for the given IPlayer. A maximum score value (Integer.MAX_VALUE) implies that the IPlayer has won the game. A minimum score value (Integer.MIN_VALUE) implies that the opponent has won the game. In general when comparing two score values returned by this interface, the one with the higher score reflects a better state position for the given IPlayer.

Parameters:
state - The current game state position
player - The player from whose perspective the game state is evaluated

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.