Algorithm
Development Kit 1.0

algs.model.gametree.debug
Class AlphaBetaDebugNode

java.lang.Object
  extended by algs.model.gametree.debug.AlphaBetaDebugNode
All Implemented Interfaces:
IGraphEntity, ISelectFont

public class AlphaBetaDebugNode
extends java.lang.Object
implements IGraphEntity, ISelectFont

This node is used when depicting debugging information about an Alpha/Beta node in the game tree path finding search.

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface algs.debug.IGraphEntity
IGraphEntity.Formatter
 
Constructor Summary
AlphaBetaDebugNode(int alpha, int beta)
          Represent a node in the search for a solution in alpha beta.
 
Method Summary
 AlphaBetaDebugNode copy()
          Generate copy of this node.
 int counter()
          Retrieve the unique identifier for this node.
 java.lang.String fontName()
          To properly draw Alpha/Beta in symbol font.
 int fontSize()
          Default font size to use is ok.
 java.lang.String nodeLabel()
          Compute label for Dotty output.
 java.lang.String toString()
          Reasonable toString() method for debugging.
 int value()
          Retrieve value for node computed so far.
 void value(int v)
          Set the value for this node based upon computation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AlphaBetaDebugNode

public AlphaBetaDebugNode(int alpha,
                          int beta)
Represent a node in the search for a solution in alpha beta.

Parameters:
alpha - known lower bound for game tree node
beta - known upper bound for game tree node
Method Detail

value

public int value()
Retrieve value for node computed so far.

Primarily here for testing


value

public void value(int v)
Set the value for this node based upon computation.

Once invoked, the 'set' field changes and the value becomes part of the visualization.

Parameters:
v - computed score value for node.

counter

public int counter()
Retrieve the unique identifier for this node.


copy

public AlphaBetaDebugNode copy()
Generate copy of this node. Useful when visiting all nodes in the game tree and needing to record progress.


toString

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

Overrides:
toString in class java.lang.Object

nodeLabel

public java.lang.String nodeLabel()
Compute label for Dotty output. To try to maximize utility, we want to show Alpha Beta in symbol font. However, once score has been set, we can't since then "score

Specified by:
nodeLabel in interface IGraphEntity

fontName

public java.lang.String fontName()
To properly draw Alpha/Beta in symbol font.

Specified by:
fontName in interface ISelectFont

fontSize

public int fontSize()
Default font size to use is ok.

Specified by:
fontSize in interface ISelectFont

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.