#include <uct.h>
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. | |
| Tree * | getTree () 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 | |
| Tree * | tree_ |
| UCT tree. | |
| Eval * | eval_ |
| Evaluation object. | |
| Node * | bestMoveNode_ |
| 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. | |
| MoveAdvisor * | advisor_ |
Constructor for parallel search.
Uses masterUct pointer to assign master brother to the root node in the actual tree.
| double Uct::decidePlayoutWinner | ( | const Board * | playBoard | ) | const [private] |
Decide winner of the game.
| 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.
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.
Node* Uct::bestMoveNode_ [private] |
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.
1.5.7.1