1 #ifndef ZZGO_UCT_TREE_H
2 #define ZZGO_UCT_TREE_H
15 * +------+ v- sibling +------+
16 * | node | ------------ | node |
19 * +------+ +------+ +------+ +------+
20 * | node | - | node | | node | - | node |
21 * +------+ +------+ +------+ +------+
25 int playouts
; // # of playouts coming through this node
26 int wins
; // # of wins coming through this node
27 float value
; // wins/playouts
32 struct tree_node
*parent
, *sibling
, *children
;
33 int depth
; // just for statistics
38 struct move_stats prior
;
43 struct tree_node
*root
;
50 struct tree
*tree_init(struct board
*board
, enum stone color
);
51 void tree_done(struct tree
*tree
);
52 void tree_dump(struct tree
*tree
, int thres
);
54 void tree_expand_node(struct tree
*tree
, struct tree_node
*node
, struct board
*b
, enum stone color
, int radar
, struct uct_policy
*policy
, int parity
);
55 void tree_delete_node(struct tree
*tree
, struct tree_node
*node
);
56 void tree_promote_node(struct tree
*tree
, struct tree_node
*node
);
57 bool tree_leaf_node(struct tree_node
*node
);