Algorithm
Development Kit 1.0

algs.model.gametree
Class MoveEvaluation

java.lang.Object
  extended by algs.model.gametree.MoveEvaluation

public class MoveEvaluation
extends java.lang.Object

Used to represent the Comparable score for a given Move.

The score for a move is not stored with the move since we believe that responsibility is not its responsibility.

Note that the minimum() and maximum() values are true negations of each other, which is essential for NegMaxEvaluation and AlphaBetaEvaluation.

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

Field Summary
 IGameMove move
          The Move.
 int score
          The score.
 
Constructor Summary
MoveEvaluation()
          Constructs empty Move Evaluation with null move and -infinity score.
MoveEvaluation(IGameMove m, int score)
          Constructs the evaluation object.
MoveEvaluation(int score)
          Constructs the evaluation object representing straight board evaluation.
 
Method Summary
static int maximum()
          Return the maximum score, so a move's score can be compared.
static int minimum()
          Return the minimum score, so a move's score can be compared.
 java.lang.String toString()
          Reasonable toString method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

score

public final int score
The score.


move

public final IGameMove move
The Move.

Constructor Detail

MoveEvaluation

public MoveEvaluation()
Constructs empty Move Evaluation with null move and -infinity score.


MoveEvaluation

public MoveEvaluation(int score)
Constructs the evaluation object representing straight board evaluation.

Used within AlphaBeta when no more moves are available.


MoveEvaluation

public MoveEvaluation(IGameMove m,
                      int score)
Constructs the evaluation object.

Parameters:
m - The move to make
score - The associated score of the resulting game state.
Method Detail

minimum

public static final int minimum()
Return the minimum score, so a move's score can be compared. Ensure it is negation of maximum()


maximum

public static final int maximum()
Return the maximum score, so a move's score can be compared. Ensure it is the negation of minimum()


toString

public java.lang.String toString()
Reasonable toString method.

Overrides:
toString in class java.lang.Object

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.