Algorithm
Development Kit 1.0

algs.model.searchtree
Interface IScore

All Known Implementing Classes:
BadEvaluator, GoodEvaluator, GoodEvaluator, WeakEvaluator

public interface IScore

The scoring function returns an int value given a board state.

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

Method Summary
 int eval(INode state)
          Evaluate the given state and return an integer that is to be used during search algorithms.
 void score(INode state)
          Evaluate the given state and update its score using our scoring function.
 

Method Detail

eval

int eval(INode state)
Evaluate the given state and return an integer that is to be used during search algorithms.

In general, the lower the score, the closer one is to a desired goal state.

Parameters:
state - The board state to be evaluated. It is unchanged.

score

void score(INode state)
Evaluate the given state and update its score using our scoring function.

Parameters:
state - The board state whose score value is to be updated.

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.