#include <GoUctSearch.h>
Inheritance diagram for GoUctState:
Definition at line 24 of file GoUctSearch.h.
Public Member Functions | |
GoUctState (std::size_t threadId, const GoBoard &bd) | |
Constructor. | |
const GoBoard & | Board () const |
Board used during in-tree phase. | |
const GoUctBoard & | UctBoard () const |
Board used during playout phase. | |
bool | IsInPlayout () const |
int | GameLength () const |
Length of the current game from the root position of the search. | |
void | Dump (std::ostream &out) const |
virtual float | Evaluate ()=0 |
virtual bool | GenerateAllMoves (std::size_t count, std::vector< SgMoveInfo > &moves, SgProvenNodeType &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 std::size_t | 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< SgMoveInfo > | m_moves |
std::vector< SgMove > | m_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 |
int | m_gameLength |
See GameLength(). | |
Classes | |
class | AssertionHandler |
Assertion handler to dump the state of a GoUctState. More... |
GoUctState::GoUctState | ( | std::size_t | threadId, | |
const GoBoard & | bd | |||
) |
Constructor.
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 99 of file GoUctSearch.cpp.
References m_bd, m_isInPlayout, m_synchronizer, and GoBoardSynchronizer::SetSubscriber().
const GoBoard & GoUctState::Board | ( | ) | const |
Board used during in-tree phase.
Definition at line 109 of file GoUctSearch.h.
References m_bd.
Referenced by GoUctGlobalSearchState< POLICY >::Evaluate(), GoUctGlobalSearchState< POLICY >::GenerateLegalMoves(), GoUctGlobalSearchState< POLICY >::GetKomi(), GoUctGlobalSearchState< POLICY >::StartPlayout(), and GoUctGlobalSearchState< POLICY >::StartSearch().
void GoUctState::Dump | ( | std::ostream & | out | ) | const |
Definition at line 109 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] |
Implementation of SgUctSearch::Execute.
Implements SgUctThreadState.
Definition at line 118 of file GoUctSearch.cpp.
References GO_MOVEFLAG_ILLEGAL, m_bd, m_gameLength, m_isInPlayout, GoBoard::Occupied(), SG_ASSERT, SG_PASS, and GoRules::SIMPLEKO.
void GoUctState::ExecutePlayout | ( | SgMove | move | ) | [virtual] |
Implementation of SgUctSearch::ExecutePlayout.
Implements SgUctThreadState.
Reimplemented in GoUctGlobalSearchState< POLICY >.
Definition at line 131 of file GoUctSearch.cpp.
References m_gameLength, m_isInPlayout, m_uctBd, GoUctBoard::Occupied(), GoUctBoard::Play(), SG_ASSERT, and SG_PASS.
Referenced by GoUctGlobalSearchState< POLICY >::ExecutePlayout().
int GoUctState::GameLength | ( | ) | const |
Length of the current game from the root position of the search.
Definition at line 114 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 139 of file GoUctSearch.cpp.
References m_gameLength, and m_isInPlayout.
Referenced by GoUctGlobalSearchState< POLICY >::GameStart().
bool GoUctState::IsInPlayout | ( | ) | const |
Definition at line 119 of file GoUctSearch.h.
References m_isInPlayout.
Referenced by GoUctGlobalSearchState< POLICY >::CheckMercyRule(), GoUctGlobalSearchState< POLICY >::Evaluate(), and GoUctGlobalSearchState< POLICY >::GeneratePlayoutMove().
void GoUctState::StartPlayout | ( | ) | [virtual] |
Reimplemented from SgUctThreadState.
Reimplemented in GoUctGlobalSearchState< POLICY >.
Definition at line 145 of file GoUctSearch.cpp.
References GoUctBoard::Init(), m_bd, and m_uctBd.
Referenced by GoUctGlobalSearchState< POLICY >::StartPlayout().
void GoUctState::StartPlayouts | ( | ) | [virtual] |
Reimplemented from SgUctThreadState.
Reimplemented in GoUctGlobalSearchState< POLICY >.
Definition at line 150 of file GoUctSearch.cpp.
References m_isInPlayout.
Referenced by GoUctGlobalSearchState< POLICY >::StartPlayouts().
void GoUctState::StartSearch | ( | ) | [virtual] |
Implements SgUctThreadState.
Reimplemented in GoUctGlobalSearchState< POLICY >.
Definition at line 155 of file GoUctSearch.cpp.
References m_synchronizer, and GoBoardSynchronizer::UpdateSubscriber().
Referenced by GoUctGlobalSearchState< POLICY >::StartSearch().
void GoUctState::TakeBackInTree | ( | std::size_t | nuMoves | ) | [virtual] |
Implements SgUctThreadState.
Definition at line 160 of file GoUctSearch.cpp.
References m_bd, and GoBoard::Undo().
void GoUctState::TakeBackPlayout | ( | std::size_t | nuMoves | ) | [virtual] |
Implements SgUctThreadState.
Definition at line 166 of file GoUctSearch.cpp.
References m_gameLength.
const GoUctBoard & GoUctState::UctBoard | ( | ) | const |
Board used during playout phase.
Definition at line 124 of file GoUctSearch.h.
References m_uctBd.
Referenced by GoUctGlobalSearchState< POLICY >::CheckMercyRule(), GoUctGlobalSearchState< POLICY >::Evaluate(), GoUctGlobalSearchState< POLICY >::ExecutePlayout(), and GoUctGlobalSearchState< POLICY >::GeneratePlayoutMove().
Definition at line 93 of file GoUctSearch.h.
GoBoard GoUctState::m_bd [private] |
Board used for in-tree phase.
Definition at line 96 of file GoUctSearch.h.
Referenced by Board(), Dump(), Execute(), GoUctState(), StartPlayout(), and TakeBackInTree().
int GoUctState::m_gameLength [private] |
See GameLength().
Definition at line 106 of file GoUctSearch.h.
Referenced by Execute(), ExecutePlayout(), GameLength(), GameStart(), and TakeBackPlayout().
bool GoUctState::m_isInPlayout [private] |
Definition at line 103 of file GoUctSearch.h.
Referenced by Dump(), Execute(), ExecutePlayout(), GameStart(), GoUctState(), IsInPlayout(), and StartPlayouts().
GoUctBoard GoUctState::m_uctBd [private] |
Board used for playout phase.
Definition at line 99 of file GoUctSearch.h.
Referenced by Dump(), ExecutePlayout(), StartPlayout(), and UctBoard().