Uct Class Reference

Uct search. More...

#include <uct.h>

List of all members.

Public Member Functions

 Uct (const Board *board)
 Preffered constructor to use.
 Uct (const Board *board, const Uct *masterUct)
 Constructor for parallel search.
void updateStatistics (Uct *ucts[], int uctsNum)
 Updates statistics after parallel search.
void searchTree (const Board *, const Engine *)
 Crucial method implementing search.
void refineResults (const Board *board)
 Results refinement after search.
void doPlayout (const Board *board)
 Does one uct-monte carlo playout.
string getStats (float seconds) const
 Get uct search statistics.
string getAdditionalInfo () const
 Get additional info - here it is the string repr.
string getBestMoveRepr () const
 String representation of the best move.
int getBestMoveVisits () const
 Visits to the best move.
float getBestMoveValue () const
 Value of best move.
float getWinRatio () const
 Estimated win ratio.
TreegetTree () const
 Tree getter.
int getPlayoutsNum () const
 Playouts_ getter.

Private Member Functions

 Uct ()
 Simple constructor.
void init (const Board *board)
 Constructor wide initialization.
double decidePlayoutWinner (const Board *) const
 Decide winner of the game.
void fill_advisor (const Board *playBoard)
 Fills advisor with moves from tactical search.

Private Attributes

Treetree_
 UCT tree.
Evaleval_
 Evaluation object.
NodebestMoveNode_
 Pointer to the most visited last step of first move.
string bestMoveRepr_
 Best move calculated from bestMoveNode_.
int playouts_
 Total number of playouts.
int uctDescends_
 Total number of uct descends through the tree.
MoveAdvisoradvisor_


Detailed Description

Uct search.

Constructor & Destructor Documentation

Uct::Uct ( const Board board,
const Uct masterUct 
)

Constructor for parallel search.

Uses masterUct pointer to assign master brother to the root node in the actual tree.


Member Function Documentation

double Uct::decidePlayoutWinner ( const Board playBoard  )  const [private]

Decide winner of the game.

Returns:
Returns value of playout based on the evaluation/playout results. Extremes are: -1 (silver wins) and 1 (gold wins)

void Uct::doPlayout ( const Board board  ) 

Does one uct-monte carlo playout.

Crucial method of search. Performs UCT descend as deep as possible and then starts the "monte carlo" playout through object SimplePlayout.

string Uct::getAdditionalInfo (  )  const

Get additional info - here it is the string repr.

of search tree.

float Uct::getWinRatio (  )  const

Estimated win ratio.

Win ratio(percentage) ~ chance of winning for player to move.

void Uct::searchTree ( const Board refBoard,
const Engine engine 
)

Crucial method implementing search.

Runs the doPlayout loop.

void Uct::updateStatistics ( Uct ucts[],
int  uctsNum 
)

Updates statistics after parallel search.

This is called in the masterUct to update information on number of playouts, descends, ... and refine the results.


Member Data Documentation

Pointer to the most visited last step of first move.

string Uct::bestMoveRepr_ [private]

Best move calculated from bestMoveNode_.

int Uct::playouts_ [private]

Total number of playouts.

int Uct::uctDescends_ [private]

Total number of uct descends through the tree.


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

Generated on Thu Aug 6 23:29:10 2009 for akimot by  doxygen 1.5.7.1