Algorithm
Development Kit 1.0

algs.model.problems.tictactoe.model
Class DefaultEvaluation

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

public class DefaultEvaluation
extends java.lang.Object
implements IGameScore

Evaluation of the board state. This evaluation is not that useful, but it can be used as a kind of strawMan when compared with a real evaluation, such as BoardEvaluation.

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

Constructor Summary
DefaultEvaluation()
           
 
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

DefaultEvaluation

public DefaultEvaluation()
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: Otherwise, the score returned is the sum of the following: Possible scores are: Note: If a board is passed in with both X and O winning, then 1,000,000 is returned.

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.