Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

GoSearch Class Reference

#include <GoSearch.h>

Inheritance diagram for GoSearch:

Inheritance graph
[legend]
List of all members.

Detailed Description

Go search.

Defines EndOfGame to return true after two passes.

Definition at line 19 of file GoSearch.h.

Public Member Functions

 GoSearch (GoBoard &board, SgSearchHashTable *hash)
GoBoardBoard ()
const GoBoardBoard () const
bool CheckDepthLimitReached () const
 Return false, because some Go searches require it.
bool EndOfGame () const
bool Execute (SgMove move, int *delta, int depth)
 Default implementation of SgSearch::Execute() for Go searches.
SgHashCode GetHashCode () const
 Default implementation of SgSearch::GetHashCode() for Go searches.
SgBlackWhite GetToPlay () const
 Default implementation of SgSearch::ToPlay() for Go searches.
void SetToPlay (SgBlackWhite toPlay)
std::string MoveString (SgMove move) const
void TakeBack ()
 Default implementation of SgSearch::TakeBack() for Go searches.
const SgSearchHashTableHashTable () const
void SetHashTable (SgSearchHashTable *hashtable)
const SgSearchControlSearchControl () const
void SetSearchControl (SgSearchControl *control)
void SetProbCut (SgProbCut *probcut)
virtual void OnStartSearch ()
int DepthFirstSearch (int depthLimit, int boundLo, int boundHi, SgVector< SgMove > *sequence, bool clearHash=true, SgNode *traceNode=0)
int DepthFirstSearch (int depthLimit, SgVector< SgMove > *sequence, bool clearHash=true, SgNode *traceNode=0)
int IteratedSearch (int depthMin, int depthMax, int boundLo, int boundHi, SgVector< SgMove > *sequence, bool clearHash=true, SgNode *traceNode=0)
int IteratedSearch (int depthMin, int depthMax, SgVector< SgMove > *sequence, bool clearHash=true, SgNode *traceNode=0)
int IteratedSearchDepthLimit () const
virtual void StartOfDepth (int depthLimit)
bool Aborted () const
void SetAbortSearch (bool fAborted=true)
void SetScout (bool flag=true)
void SetKillers (bool flag=true)
void SetOpponentBest (bool flag=true)
void SetNullMove (bool flag=true)
void SetNullMoveDepth (int depth)
void GetStatistics (SgSearchStatistics *stat)
const SgSearchStatisticsStatistics () const
void StartTime ()
void StopTime ()
virtual void Generate (SgVector< SgMove > *moves, int depth)=0
virtual int Evaluate (bool *isExact, int depth)=0
virtual bool AbortSearch ()
int CurrentDepth () const
SgMove PrevMove () const
SgMove PrevMove2 () const
void InitSearch (int startDepth=0)
bool TraceIsOn () const
virtual void CreateTracer ()
void SetTracer (SgSearchTracer *tracer)
SgSearchTracerTracer () const
void SetAbortFrequency (int value)
int SearchEngine (int depth, int alpha, int beta, SgStack< SgMove, SgSearch::MAX_DEPTH > &stack, bool *isExactValue, bool lastNullMove=false)

Static Public Attributes

static const int DEPTH_UNIT
static const int MAX_DEPTH
static const int SG_INFINITY

Private Attributes

GoBoardm_board


Constructor & Destructor Documentation

GoSearch::GoSearch ( GoBoard board,
SgSearchHashTable hash 
)

Definition at line 20 of file GoSearch.cpp.

References SgSearch::SetOpponentBest().


Member Function Documentation

const GoBoard & GoSearch::Board (  )  const

Definition at line 70 of file GoSearch.h.

References m_board.

GoBoard & GoSearch::Board (  ) 

Definition at line 65 of file GoSearch.h.

References m_board.

Referenced by Execute(), GetHashCode(), GetToPlay(), SetToPlay(), and TakeBack().

bool GoSearch::CheckDepthLimitReached (  )  const [virtual]

Return false, because some Go searches require it.

Todo:
Remove. Implement it in the subclasses, because it depends on the move generation there.

Implements SgSearch.

Definition at line 27 of file GoSearch.cpp.

bool GoSearch::EndOfGame (  )  const [virtual]

Implements SgSearch.

Definition at line 32 of file GoSearch.cpp.

References SgSearch::PrevMove(), SgSearch::PrevMove2(), and SG_PASS.

bool GoSearch::Execute ( SgMove  move,
int *  delta,
int  depth 
) [virtual]

Default implementation of SgSearch::Execute() for Go searches.

Executes the move is legal.

Implements SgSearch.

Definition at line 37 of file GoSearch.cpp.

References Board(), GoBoardUtil::PlayIfLegal(), SG_UNUSED(), and GoBoard::ToPlay().

SgHashCode GoSearch::GetHashCode (  )  const [virtual]

Default implementation of SgSearch::GetHashCode() for Go searches.

Returns:
Board().GetHashCodeInclToPlay().

Implements SgSearch.

Definition at line 48 of file GoSearch.cpp.

References Board(), and GoBoard::GetHashCodeInclToPlay().

SgBlackWhite GoSearch::GetToPlay (  )  const [virtual]

Default implementation of SgSearch::ToPlay() for Go searches.

Returns:
Board().ToPlay().

Implements SgSearch.

Definition at line 53 of file GoSearch.cpp.

References Board(), and GoBoard::ToPlay().

std::string GoSearch::MoveString ( SgMove  move  )  const [virtual]

Implements SgSearch.

Definition at line 58 of file GoSearch.cpp.

void GoSearch::SetToPlay ( SgBlackWhite  toPlay  )  [virtual]

Implements SgSearch.

Definition at line 65 of file GoSearch.cpp.

References Board(), and GoBoard::SetToPlay().

void GoSearch::TakeBack (  )  [virtual]

Default implementation of SgSearch::TakeBack() for Go searches.

Takes back the move on the board.

Implements SgSearch.

Definition at line 70 of file GoSearch.cpp.

References Board(), and GoBoard::Undo().


Member Data Documentation

GoBoard& GoSearch::m_board [private]

Definition at line 62 of file GoSearch.h.

Referenced by Board().


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


17 Jun 2010 Doxygen 1.4.7