Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgUctChildIterator Class Reference
[Monte Carlo tree search]

#include <SgUctTree.h>

List of all members.

Detailed Description

Iterator over all children of a node.

It was intentionally implemented to be used only, if at least one child exists (checked with an assertion), since in many use cases, the case of no children needs to be handled specially and should be checked before doing a loop over all children.

Definition at line 1017 of file SgUctTree.h.

Public Member Functions

 SgUctChildIterator (const SgUctTree &tree, const SgUctNode &node)
const SgUctNodeoperator * () const
void operator++ ()
 operator bool () const

Private Attributes

const SgUctNodem_current
const SgUctNodem_last

Constructor & Destructor Documentation

SgUctChildIterator::SgUctChildIterator ( const SgUctTree tree,
const SgUctNode node 


Requires: node.HasChildren()

Definition at line 1037 of file SgUctTree.h.

References SgUctTree::Contains(), SgUctNode::FirstChild(), SgUctNode::HasChildren(), m_current, m_last, SgUctNode::NuChildren(), SG_ASSERT, and SG_DEBUG_ONLY.

Member Function Documentation

const SgUctNode & SgUctChildIterator::operator * (  )  const

Definition at line 1047 of file SgUctTree.h.

References m_current.

SgUctChildIterator::operator bool (  )  const

Definition at line 1057 of file SgUctTree.h.

References m_current, and m_last.

void SgUctChildIterator::operator++ (  ) 

Definition at line 1052 of file SgUctTree.h.

References m_current.

Member Data Documentation

const SgUctNode* SgUctChildIterator::m_current [private]

Definition at line 1032 of file SgUctTree.h.

Referenced by operator *(), operator bool(), operator++(), and SgUctChildIterator().

const SgUctNode* SgUctChildIterator::m_last [private]

Definition at line 1034 of file SgUctTree.h.

Referenced by operator bool(), and SgUctChildIterator().

The documentation for this class was generated from the following file:

17 Jun 2010 Doxygen 1.4.7