Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Static Public Attributes | Private Attributes

GoSearch Class Reference

Go search. More...

#include <GoSearch.h>

Inheritance diagram for GoSearch:
Inheritance graph
[legend]

List of all members.

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, SgSearchStack &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

Detailed Description

Go search.

Defines EndOfGame to return true after two passes.

Definition at line 17 of file GoSearch.h.


Constructor & Destructor Documentation

GoSearch::GoSearch ( GoBoard board,
SgSearchHashTable hash 
)

Definition at line 19 of file GoSearch.cpp.

References SgSearch::SetOpponentBest().


Member Function Documentation

GoBoard & GoSearch::Board (  ) 

Definition at line 58 of file GoSearch.h.

References m_board.

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

const GoBoard & GoSearch::Board (  )  const

Definition at line 63 of file GoSearch.h.

References m_board.

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 26 of file GoSearch.cpp.

bool GoSearch::EndOfGame (  )  const [virtual]

Implements SgSearch.

Definition at line 31 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 36 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 47 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 52 of file GoSearch.cpp.

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

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

Implements SgSearch.

Definition at line 57 of file GoSearch.cpp.

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

Implements SgSearch.

Definition at line 64 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 69 of file GoSearch.cpp.

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


Member Data Documentation

Definition at line 55 of file GoSearch.h.

Referenced by Board().


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


Sun Mar 13 2011 Doxygen 1.7.1