Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgUctTreeUtil Namespace Reference
[Monte Carlo tree search]


Detailed Description

Utility functions for users of SgUctTree.


Functions

void ExtractSubtree (const SgUctTree &tree, SgUctTree &target, const std::vector< SgMove > &sequence, bool warnTruncate, double maxTime=std::numeric_limits< double >::max())
 Extract the subtree from the node after a sequence of moves.
const SgUctNodeFindChildWithMove (const SgUctTree &tree, const SgUctNode &node, SgMove move)
 Find move node with a given move.


Function Documentation

void SgUctTreeUtil::ExtractSubtree ( const SgUctTree tree,
SgUctTree target,
const std::vector< SgMove > &  sequence,
bool  warnTruncate,
double  maxTime = std::numeric_limits< double >::max() 
)

Extract the subtree from the node after a sequence of moves.

The result is an empty tree, if the sequence of moves does not correspond to a sequence of nodes from the root node in the given tree.

Parameters:
tree The source tree.
[out] target The target tree (will be cleared before using it).
sequence The sequence of moves.
warnTruncate See SgUctTree::ExtractSubtree
maxTime See SgUctTree::ExtractSubtree

Definition at line 79 of file SgUctTreeUtil.cpp.

References SgUctTree::Clear(), SgUctTree::ExtractSubtree(), FindChildWithMove(), and SgUctTree::Root().

const SgUctNode * SgUctTreeUtil::FindChildWithMove ( const SgUctTree tree,
const SgUctNode node,
SgMove  move 
)

Find move node with a given move.

Returns:
The child node or 0, if the position node has no such child.

Definition at line 96 of file SgUctTreeUtil.cpp.

References SgUctNode::HasChildren().

Referenced by ExtractSubtree().


17 Jun 2010 Doxygen 1.4.7