Main Page | Class Hierarchy | Class List | File List | Class Members

TreeNode Class Reference

This class represents the node of solution tree. More...

#include <tree.h>

Collaboration diagram for TreeNode:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TreeNode (Board data)
 Standard constructor.

 TreeNode (Board data, TreeNode *parent)
 Standard constructor to build children nodes.

virtual ~TreeNode ()
 Standard destructor.

Board getData ()
 Return state of node.

void setData (Board data)
 Sets stata data of node.

void addChild (Board data)
 Creates child with data initialization.

void setBrother (TreeNode *bro)
 Sets brother node.

TreeNodegetBrother ()
 Gets brother pointer.

TreeNodegetParent ()
 Gets parent pointer.

TreeNodegetChild ()
 Gets children pointer.

void createChilds (int count, Board *data)
 Creates node childrens with intialization.

void createChilds (vector< Board > data)
 Creates node childrens with intialization.

TreeNodeexpand (int no)
 This expands the node for player number no.

TreeNodeexpand (int no, vector< int > &moveAt)
 This expands the node for player number no.

float minimaxABMin (float a, float b, int no, int level)
 The minimax search method for minimal level.

float minimaxABMax (float a, float b, int no, int level)
 The minimax search method for maximal level.

float depthSearch (int level, int stopLevel, int no, int moveAt)
 The depth search method.


Protected Attributes

Board data
 State of game.

TreeNodeparent
 Pointer to parent node.

TreeNodebrother
 Pointer to brother node.

TreeNodechild
 Pointer to first child node.

float alpha
 The aplha value of node.

float beta
 The beta value of node.


Detailed Description

This class represents the node of solution tree.

This class encapsulate information of game state and other information to able to navigate through tree.


Constructor & Destructor Documentation

TreeNode::TreeNode Board  data  ) 
 

Standard constructor.

This constructor is used to create root node. It also intialize the state of node.

Parameters:
data The state of node.

Here is the call graph for this function:

TreeNode::TreeNode Board  data,
TreeNode parent
 

Standard constructor to build children nodes.

This constructor is used to create children node. It also intialize the state of node.

Parameters:
data The state of node.
parent The point to parent node.

Here is the call graph for this function:

TreeNode::~TreeNode  )  [virtual]
 

Standard destructor.

This dealocates root node, all brothers and childrens.


Member Function Documentation

void TreeNode::addChild Board  data  ) 
 

Creates child with data initialization.

This adds children node fot this node.

Parameters:
data The state data of children node.

Here is the call graph for this function:

void TreeNode::createChilds vector< Board data  ) 
 

Creates node childrens with intialization.

Parameters:
data The STL vector of children state datas.

Here is the call graph for this function:

void TreeNode::createChilds int  count,
Board data
 

Creates node childrens with intialization.

Parameters:
count The count of childrens.
data The array of children state datas.

Here is the call graph for this function:

float TreeNode::depthSearch int  level,
int  stopLevel,
int  no,
int  moveAt
 

The depth search method.

Parameters:
level Current level of node in tree.
stopLevel The number of level to stop expanding.
no The nubmer of player.
moveAt The position of last player move/
Returns:
Value of node.

Here is the call graph for this function:

TreeNode * TreeNode::expand int  no,
vector< int > &  moveAt
 

This expands the node for player number no.

Parameters:
no The number of player.
moveAt The vector to be filled with moveAt position for each children.
Returns:
The pointer to first children node.

Here is the call graph for this function:

TreeNode * TreeNode::expand int  no  ) 
 

This expands the node for player number no.

Parameters:
no The number of player.
Returns:
The pointer to first children node.

Here is the call graph for this function:

TreeNode * TreeNode::getBrother  ) 
 

Gets brother pointer.

Returns:
Pointer to brother node.

TreeNode * TreeNode::getChild  ) 
 

Gets children pointer.

Returns:
Pointer to first children node.

Board TreeNode::getData  ) 
 

Return state of node.

Returns:
The state (board) of this node.

TreeNode * TreeNode::getParent  ) 
 

Gets parent pointer.

Returns:
Pointer to parent node.

float TreeNode::minimaxABMax float  a,
float  b,
int  no,
int  level
 

The minimax search method for maximal level.

Parameters:
a Initial alpha value.
b initial beta value.
no The number of player the moves are generated for.
level Actual level of node in tree.
Returns:
Value of node.

Here is the call graph for this function:

float TreeNode::minimaxABMin float  a,
float  b,
int  no,
int  level
 

The minimax search method for minimal level.

Parameters:
a Initial alpha value.
b initial beta value.
no The number of player the moves are generated for.
level Actual level of node in tree.
Returns:
Value of node.

Here is the call graph for this function:

void TreeNode::setBrother TreeNode bro  )  [inline]
 

Sets brother node.

Parameters:
bro The pointer to new brother.

Here is the call graph for this function:

void TreeNode::setData Board  data  ) 
 

Sets stata data of node.

Parameters:
data The new state data.

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Fri May 14 02:44:30 2004 for Reversi by doxygen 1.3.7