Algorithm
Development Kit 1.0

algs.model.problems.tictactoe.model
Class BoardEvaluation

java.lang.Object
  extended by algs.model.problems.tictactoe.model.BoardEvaluation
All Implemented Interfaces:
IGameScore

public class BoardEvaluation
extends java.lang.Object
implements IGameScore

Evaluation of the board state as taken from Nilsson, p. 139

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

Constructor Summary
BoardEvaluation()
           
 
Method Summary
 int score(IGameState state, IPlayer ip)
          Provides a default evaluation function for the given board state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoardEvaluation

public BoardEvaluation()
Method Detail

score

public int score(IGameState state,
                 IPlayer ip)
Provides a default evaluation function for the given board state. The evaluation is taken from the point of view of a given player AFTER he has made his move.

If the board state is:

Specified by:
score in interface IGameScore
Parameters:
state - The state of the game
ip - The player who has just made their move
Returns:
integer representing board score.

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.