Algorithm
Development Kit 1.0

algs.model.problems.tictactoe.debug
Class TicTacToeDebugger

java.lang.Object
  extended by algs.debug.DottyDebugger
      extended by algs.model.problems.tictactoe.debug.TicTacToeDebugger
All Implemented Interfaces:
IDebugSearch

public class TicTacToeDebugger
extends DottyDebugger

Extends GameTreeDebugger to work with TicTacToe nodes. Since the state is mutated by the algorithm, we must maintain our local copies in a hash table.

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

Field Summary
 
Fields inherited from class algs.debug.DottyDebugger
_ctr, BreadthFirstOrdering, defaultFontName, defaultFontSize, DepthFirstOrdering, discarded, edges, goal, nodes, start, TooLarge, unexplored
 
Constructor Summary
TicTacToeDebugger()
           
 
Method Summary
protected  java.lang.String getKey(IGraphEntity value)
          Helper function to reverse locate the key.
 void visitNode(IGraphEntity n)
          Mark node as being visited.
 
Methods inherited from class algs.debug.DottyDebugger
complete, edgeType, getInputString, labelEdge, markDiscarded, markEdge, markGoal, markStart, markUnexplored, nodeType, numNodes, ordering, rank, visitEdge, visitEdge
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TicTacToeDebugger

public TicTacToeDebugger()
Method Detail

visitNode

public void visitNode(IGraphEntity n)
Mark node as being visited. Special case for our purposes is to use generated state number from search process. While this is a bit of a "hack", it makes it easy to generate effective visualizations of the search.

Specified by:
visitNode in interface IDebugSearch
Overrides:
visitNode in class DottyDebugger
Parameters:
n - node to be visited

getKey

protected java.lang.String getKey(IGraphEntity value)
Helper function to reverse locate the key.

Overrides:
getKey in class DottyDebugger

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.