Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

HexUctUtil Namespace Reference

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.

Detailed Description

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.


Function Documentation

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:

  • Move values as influence
  • Move counts as labels
  • Move with best value marked with circle
  • Best response marked with triangle
  • Move with highest count marked with square (if different from move with best value)
  • Status line text:
    • N = Number games
    • V = Value of root node
    • Len = Average simulation sequence length
    • Tree = Average/maximum moves of simulation sequence in tree
    • Abrt = Percentage of games aborted (due to maximum game length)
    • Gm/s = Simulations per second
      Parameters:
      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().


6 Jan 2011 Doxygen 1.6.3