Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgSearchTracer Class Reference

#include <SgSearchTracer.h>

List of all members.


Detailed Description

Traces a search.

Definition at line 19 of file SgSearchTracer.h.

Public Member Functions

 SgSearchTracer (SgNode *root)
virtual ~SgSearchTracer ()
void AddTraceNode (SgMove move, SgBlackWhite player)
 Adds the given move as a new node to the trace tree and goes to that node.
SgNodeTraceNode () const
 Current node.
void TraceComment (const char *comment) const
 Add comment to current tracenode.
void StartOfDepth (int depth)
virtual void AddMoveProp (SgNode *node, SgMove move, SgBlackWhite player)
 Adds move property to node (game-dependent).
void TraceValue (int value, SgBlackWhite toPlay) const
 Add value as a comment to current tracenode.
void TraceValue (int value, SgBlackWhite toPlay, const char *comment, bool isExact) const
 Add value and text as a comment to current tracenode.
void TakeBackTraceNode ()
 Go one move up in the trace tree.
virtual bool TraceIsOn () const
 Is tracing on? Default implementation always returns true.
virtual void InitTracing (const std::string &type)
 Creates a new root node for tracing.
void AppendTrace (SgNode *toNode)
 Move trace tree to a subtree of toNode, and set m_traceNode = 0.

Protected Attributes

SgNodem_traceNode
 Current node in tracing.

Private Member Functions

 SgSearchTracer (const SgSearchTracer &)
 Not implemented.
SgSearchTraceroperator= (const SgSearchTracer &)
 Not implemented.


Constructor & Destructor Documentation

SgSearchTracer::SgSearchTracer ( SgNode root  ) 

Definition at line 28 of file SgSearchTracer.cpp.

SgSearchTracer::~SgSearchTracer (  )  [virtual]

Definition at line 33 of file SgSearchTracer.cpp.

SgSearchTracer::SgSearchTracer ( const SgSearchTracer  )  [private]

Not implemented.


Member Function Documentation

void SgSearchTracer::AddMoveProp ( SgNode node,
SgMove  move,
SgBlackWhite  player 
) [virtual]

Adds move property to node (game-dependent).

The default implementation stores the move in a SgMoveProp. Override this method for other games.

Definition at line 37 of file SgSearchTracer.cpp.

References SgNode::AddMoveProp().

Referenced by AddTraceNode().

void SgSearchTracer::AddTraceNode ( SgMove  move,
SgBlackWhite  player 
)

Adds the given move as a new node to the trace tree and goes to that node.

Doesn't do anything if m_traceNode is 0.

Definition at line 43 of file SgSearchTracer.cpp.

References AddMoveProp(), m_traceNode, and SgNode::NewRightMostSon().

Referenced by SgSearch::CallExecute().

void SgSearchTracer::AppendTrace ( SgNode toNode  ) 

Move trace tree to a subtree of toNode, and set m_traceNode = 0.

Definition at line 52 of file SgSearchTracer.cpp.

References SgNode::AppendTo(), m_traceNode, and SgNode::Root().

Referenced by SgSearch::DepthFirstSearch(), and SgSearch::IteratedSearch().

void SgSearchTracer::InitTracing ( const std::string &  type  )  [virtual]

Creates a new root node for tracing.

Override to add information

Definition at line 61 of file SgSearchTracer.cpp.

References SgNode::Add(), m_traceNode, SG_ASSERT, and SG_PROP_COMMENT.

Referenced by SgSearch::DepthFirstSearch(), and SgSearch::IteratedSearch().

SgSearchTracer& SgSearchTracer::operator= ( const SgSearchTracer  )  [private]

Not implemented.

void SgSearchTracer::StartOfDepth ( int  depth  ) 

Definition at line 68 of file SgSearchTracer.cpp.

References SgNode::AddComment(), SgNode::Father(), SgNode::HasFather(), m_traceNode, SgNode::NewRightMostSon(), SgNode::SetIntProp(), SG_ASSERT, and SG_PROP_MAX_DEPTH.

Referenced by SgSearch::StartOfDepth().

void SgSearchTracer::TakeBackTraceNode (  ) 

Go one move up in the trace tree.

Don't do anything if m_traceNode is null. To be called from the client's TakeBack method.

Definition at line 92 of file SgSearchTracer.cpp.

References SgNode::Father(), and m_traceNode.

Referenced by SgSearch::CallTakeBack().

void SgSearchTracer::TraceComment ( const char *  comment  )  const

Add comment to current tracenode.

Definition at line 98 of file SgSearchTracer.cpp.

References SgNode::AddComment(), and m_traceNode.

Referenced by SgSearch::AbortSearch(), SgSearch::NullMovePrune(), TraceValue(), and SgSearch::TryMove().

bool SgSearchTracer::TraceIsOn (  )  const [virtual]

Is tracing on? Default implementation always returns true.

Definition at line 84 of file SgSearchTracer.h.

Referenced by SgSearch::DepthFirstSearch(), SgSearch::IteratedSearch(), and SgSearch::TraceIsOn().

SgNode * SgSearchTracer::TraceNode (  )  const

Current node.

Definition at line 79 of file SgSearchTracer.h.

References m_traceNode.

Referenced by SgSearch::DepthFirstSearch(), and SgSearch::IteratedSearch().

void SgSearchTracer::TraceValue ( int  value,
SgBlackWhite  toPlay,
const char *  comment,
bool  isExact 
) const

Add value and text as a comment to current tracenode.

Definition at line 116 of file SgSearchTracer.cpp.

References SgNode::Add(), m_traceNode, SG_PROP_CHECK, TraceComment(), and TraceValue().

void SgSearchTracer::TraceValue ( int  value,
SgBlackWhite  toPlay 
) const

Add value as a comment to current tracenode.

Definition at line 107 of file SgSearchTracer.cpp.

References SgNode::Add(), m_traceNode, SG_ASSERT, SG_PROP_VALUE, and SG_WHITE.

Referenced by TraceValue().


Member Data Documentation

SgNode* SgSearchTracer::m_traceNode [protected]

Current node in tracing.

Definition at line 69 of file SgSearchTracer.h.

Referenced by AddTraceNode(), AppendTrace(), InitTracing(), StartOfDepth(), TakeBackTraceNode(), TraceComment(), TraceNode(), and TraceValue().


The documentation for this class was generated from the following files:


17 Jun 2010 Doxygen 1.4.7