Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Private Attributes

SgUctChildIterator Class Reference
[Monte Carlo tree search]

Iterator over all children of a node. More...

#include <SgUctTree.h>

List of all members.

Public Member Functions

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

Private Attributes

const SgUctNodem_current
const SgUctNodem_last

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 1060 of file SgUctTree.h.


Constructor & Destructor Documentation

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

Constructor.

Requires: node.HasChildren()

Definition at line 1079 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

SgUctChildIterator::operator bool (  )  const

Definition at line 1099 of file SgUctTree.h.

References m_current, and m_last.

const SgUctNode & SgUctChildIterator::operator* (  )  const

Definition at line 1089 of file SgUctTree.h.

References m_current.

void SgUctChildIterator::operator++ (  ) 

Definition at line 1094 of file SgUctTree.h.

References m_current.


Member Data Documentation

Definition at line 1074 of file SgUctTree.h.

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

Definition at line 1076 of file SgUctTree.h.

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


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


Sun Mar 13 2011 Doxygen 1.7.1