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

GoUctState Class Reference

Thread state for GoUctSearch. More...

#include <GoUctSearch.h>

Inheritance diagram for GoUctState:
Inheritance graph
[legend]

List of all members.

Classes

class  AssertionHandler
 Assertion handler to dump the state of a GoUctState. More...

Public Member Functions

 GoUctState (unsigned int threadId, const GoBoard &bd)
 Constructor.
const GoBoardBoard () const
 Board used during in-tree phase.
const GoUctBoardUctBoard () const
 Board used during playout phase.
bool IsInPlayout () const
std::size_t GameLength () const
 Length of the current game from the root position of the search.
void Dump (std::ostream &out) const
virtual SgUctValue Evaluate ()=0
virtual bool GenerateAllMoves (SgUctValue count, std::vector< SgUctMoveInfo > &moves, SgUctProvenType &provenType)=0
virtual SgMove GeneratePlayoutMove (bool &skipRaveUpdate)=0
virtual void EndPlayout ()
Pure virtual functions of SgUctThreadState

void StartSearch ()
void Execute (SgMove move)
 Implementation of SgUctSearch::Execute.
void ExecutePlayout (SgMove move)
 Implementation of SgUctSearch::ExecutePlayout.
void TakeBackInTree (std::size_t nuMoves)
void TakeBackPlayout (std::size_t nuMoves)
Virtual functions of SgUctThreadState

void GameStart ()
void StartPlayout ()
void StartPlayouts ()

Public Attributes

const unsigned int m_threadId
bool m_isSearchInitialized
bool m_isTreeOutOfMem
SgUctGameInfo m_gameInfo
boost::scoped_array< std::size_t > m_firstPlay
boost::scoped_array< std::size_t > m_firstPlayOpp
std::vector< SgUctMoveInfom_moves
std::vector< SgMovem_excludeMoves
int m_randomizeCounter

Private Attributes

AssertionHandler m_assertionHandler
GoBoard m_bd
 Board used for in-tree phase.
GoUctBoard m_uctBd
 Board used for playout phase.
GoBoardSynchronizer m_synchronizer
bool m_isInPlayout
std::size_t m_gameLength
 See GameLength().

Detailed Description

Thread state for GoUctSearch.

Definition at line 22 of file GoUctSearch.h.


Constructor & Destructor Documentation

GoUctState::GoUctState ( unsigned int  threadId,
const GoBoard bd 
)

Constructor.

Parameters:
threadId The number of the thread. Needed for passing to constructor of SgUctThreadState.
bd The board with the current position. The state has is own board that will be synchronized with the currently searched position in StartSearch()

Definition at line 98 of file GoUctSearch.cpp.

References m_bd, m_isInPlayout, m_synchronizer, and GoBoardSynchronizer::SetSubscriber().


Member Function Documentation

const GoBoard & GoUctState::Board (  )  const
void GoUctState::Dump ( std::ostream &  out  )  const

Definition at line 108 of file GoUctSearch.cpp.

References m_bd, m_isInPlayout, SgUctThreadState::m_threadId, and m_uctBd.

Referenced by GoUctState::AssertionHandler::Run().

void GoUctState::Execute ( SgMove  move  )  [virtual]
void GoUctState::ExecutePlayout ( SgMove  move  )  [virtual]

Implementation of SgUctSearch::ExecutePlayout.

Implements SgUctThreadState.

Reimplemented in GoUctGlobalSearchState< POLICY >.

Definition at line 130 of file GoUctSearch.cpp.

References m_gameLength, m_isInPlayout, m_uctBd, GoUctBoard::Occupied(), GoUctBoard::Play(), SG_ASSERT, and SG_PASS.

std::size_t GoUctState::GameLength (  )  const

Length of the current game from the root position of the search.

Definition at line 111 of file GoUctSearch.h.

References m_gameLength.

Referenced by GoUctGlobalSearchState< POLICY >::EvaluateBoard().

void GoUctState::GameStart (  )  [virtual]

Reimplemented from SgUctThreadState.

Reimplemented in GoUctGlobalSearchState< POLICY >.

Definition at line 138 of file GoUctSearch.cpp.

References m_gameLength, and m_isInPlayout.

bool GoUctState::IsInPlayout (  )  const
void GoUctState::StartPlayout (  )  [virtual]

Reimplemented from SgUctThreadState.

Reimplemented in GoUctGlobalSearchState< POLICY >.

Definition at line 144 of file GoUctSearch.cpp.

References GoUctBoard::Init(), m_bd, and m_uctBd.

void GoUctState::StartPlayouts (  )  [virtual]

Reimplemented from SgUctThreadState.

Reimplemented in GoUctGlobalSearchState< POLICY >.

Definition at line 149 of file GoUctSearch.cpp.

References m_isInPlayout.

void GoUctState::StartSearch (  )  [virtual]

Implements SgUctThreadState.

Reimplemented in GoUctGlobalSearchState< POLICY >.

Definition at line 154 of file GoUctSearch.cpp.

References m_synchronizer, and GoBoardSynchronizer::UpdateSubscriber().

void GoUctState::TakeBackInTree ( std::size_t  nuMoves  )  [virtual]

Implements SgUctThreadState.

Definition at line 159 of file GoUctSearch.cpp.

References m_bd, and GoBoard::Undo().

void GoUctState::TakeBackPlayout ( std::size_t  nuMoves  )  [virtual]

Implements SgUctThreadState.

Definition at line 165 of file GoUctSearch.cpp.

References m_gameLength.

const GoUctBoard & GoUctState::UctBoard (  )  const

Member Data Documentation

Definition at line 90 of file GoUctSearch.h.

Board used for in-tree phase.

Definition at line 93 of file GoUctSearch.h.

Referenced by Board(), Dump(), Execute(), GoUctState(), StartPlayout(), and TakeBackInTree().

std::size_t GoUctState::m_gameLength [private]

See GameLength().

Definition at line 103 of file GoUctSearch.h.

Referenced by Execute(), ExecutePlayout(), GameLength(), GameStart(), and TakeBackPlayout().

bool GoUctState::m_isInPlayout [private]

Definition at line 98 of file GoUctSearch.h.

Referenced by GoUctState(), and StartSearch().

Board used for playout phase.

Definition at line 96 of file GoUctSearch.h.

Referenced by Dump(), ExecutePlayout(), StartPlayout(), and UctBoard().


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


Sun Mar 13 2011 Doxygen 1.7.1