Algorithm
Development Kit 1.0

algs.debug
Interface IDebugSearch

All Known Implementing Classes:
BinaryTreeDebugger, DottyDebugger, RightThreadTreeDebugger, TicTacToeDebugger

public interface IDebugSearch

Used by animation and other purposes to track the status of a Search.

This debugger gathers statistics during each visitNode and transition method calls. Simple debuggers could output information as it happens. More complex debuggers will build a model that will only be output at the completion of the search, which is known after the complete() method is invoked.

The arguments are all generic, since the debugger that implements this interface is the only one who knows the true type of the information. Naturally, make sure you only attach a proper debugger to the proper information source.

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

Method Summary
 void complete()
          Complete any processing to make this information available.
 void markDiscarded(IGraphEntity n)
          Mark node as being discarded.
 void markEdge(IGraphEntity n1, IGraphEntity n2)
          Mark edge that was part of a solution.
 void markGoal(IGraphEntity n)
          Mark search goal (or null for failed search).
 void markStart(IGraphEntity n)
          Mark search initial location.
 void markUnexplored(IGraphEntity n)
          Mark node as being unexplored.
 void visitEdge(IGraphEntity n1, IGraphEntity n2)
          Visit an edge.
 void visitNode(IGraphEntity n)
          Visit a node.
 

Method Detail

visitNode

void visitNode(IGraphEntity n)
Visit a node.

Parameters:
n - node to be visited

visitEdge

void visitEdge(IGraphEntity n1,
               IGraphEntity n2)
Visit an edge. Only invoke after both nodes have been visited.

Parameters:
n1 - source node
n2 - target node

markStart

void markStart(IGraphEntity n)
Mark search initial location. Only invoke after Node has been visited.

Parameters:
n - Node to be marked

markGoal

void markGoal(IGraphEntity n)
Mark search goal (or null for failed search). Only invoke after Node has been visited.

Parameters:
n - Node to be marked

markUnexplored

void markUnexplored(IGraphEntity n)
Mark node as being unexplored. These are typically nodes placed on the OPEN list that were never explored. Since they appear in the output, we don't want to give the impression that they were considered.

Parameters:
n - node to be marked

markDiscarded

void markDiscarded(IGraphEntity n)
Mark node as being discarded. Currently not being used by any debugger.

Parameters:
n -

markEdge

void markEdge(IGraphEntity n1,
              IGraphEntity n2)
Mark edge that was part of a solution. Only invoke after edge has been visited.

Parameters:
n1 - source of edge
n2 - target of edge

complete

void complete()
Complete any processing to make this information available.


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.