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 SgUctNode * | FindChildWithMove (const SgUctTree &tree, const SgUctNode &node, SgMove move) |
Find move node with a given move. |
Utility functions for users of SgUctTree.
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.
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.
Definition at line 97 of file SgUctTreeUtil.cpp.
References SgUctNode::HasChildren(), and SgUctNode::Move().
Referenced by ExtractSubtree().