Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Functions

SgUctTreeUtil Namespace Reference
[Monte Carlo tree search]

Utility functions for users of SgUctTree. More...

Functions

void ExtractSubtree (const SgUctTree &tree, SgUctTree &target, const std::vector< SgMove > &sequence, bool warnTruncate, double maxTime=std::numeric_limits< double >::max(), SgUctValue minCount=0)
 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.

Detailed Description

Utility functions for users of SgUctTree.


Function Documentation

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

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
minCount 

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 97 of file SgUctTreeUtil.cpp.

References SgUctNode::HasChildren(), and SgUctNode::Move().

Referenced by ExtractSubtree().


Sun Mar 13 2011 Doxygen 1.7.1