General utility functions used in GoUct. More...
Functions | |
| void | GoGuiGfx (const SgUctSearch &search, SgBlackWhite toPlay, std::ostream &out) |
| Print information about search as Gfx commands for GoGui. | |
| int | ComputeMaxNumMoves () |
| RAVE is more efficient if we know the max number of moves we can have. | |
| std::string | MoveString (SgMove move) |
| Method used to print SgMoves during UCT. | |
| SgBlackWhite | ToSgBlackWhite (HexColor c) |
| Converts a HexColor to SgBlackWhite (Note: cannot be EMPTY). | |
| void | SaveTree (const SgUctTree &tree, const StoneBoard &brd, HexColor toPlay, std::ostream &out, int maxDepth) |
| Saves the uct tree to an sgf. | |
General utility functions used in GoUct.
These functions are used in GoUct, but should not depend on other classes in GoUct to avoid cyclic dependencies.
| int HexUctUtil::ComputeMaxNumMoves | ( | ) |
RAVE is more efficient if we know the max number of moves we can have.
Simply returns FIRST_INVALID.
Definition at line 82 of file HexUctUtil.cpp.
References FIRST_INVALID.
| void HexUctUtil::GoGuiGfx | ( | const SgUctSearch & | search, | |
| SgBlackWhite | toPlay, | |||
| std::ostream & | out | |||
| ) |
Print information about search as Gfx commands for GoGui.
Can be used for GoGui live graphics during the search or GoGui analyze command type "gfx" after the search (see http://gogui.sf.net). The following information is output:
| search | The search containing the tree and statistics | |
| toPlay | The color toPlay at the root node of the tree | |
| out | The stream to write the gfx commands to |
Definition at line 36 of file HexUctUtil.cpp.
References GoGuiGfxStatus(), and MoveString().
Referenced by HexUctSearch::OnSearchIteration().
| std::string HexUctUtil::MoveString | ( | SgMove | move | ) |
Method used to print SgMoves during UCT.
Definition at line 87 of file HexUctUtil.cpp.
References FIRST_INVALID, HexAssert, and HexPointUtil::ToString().
Referenced by GoGuiGfx(), and MoHexPlayer::Search().
| void HexUctUtil::SaveTree | ( | const SgUctTree & | tree, | |
| const StoneBoard & | brd, | |||
| HexColor | toPlay, | |||
| std::ostream & | out, | |||
| int | maxDepth | |||
| ) |
Saves the uct tree to an sgf.
Definition at line 160 of file HexUctUtil.cpp.
References BLACK, EMPTY, StoneBoard::Stones(), WHITE, and StoneBoard::Width().
| SgBlackWhite HexUctUtil::ToSgBlackWhite | ( | HexColor | c | ) |
Converts a HexColor to SgBlackWhite (Note: cannot be EMPTY).
Definition at line 96 of file HexUctUtil.cpp.
References BLACK, HexAssert, and WHITE.
Referenced by HexUctSearch::OnSearchIteration(), and HexUctState::ToPlay().