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 * +------+ +------+ +------+ +------+
26 struct tree_node
*parent
, *sibling
, *children
;
27 int depth
; // just for statistics
31 int playouts
; // # of playouts coming through this node
32 int wins
; // # of wins coming through this node
33 float value
; // wins/playouts
37 struct tree_node
*root
;
44 struct tree
*tree_init(struct board
*board
, enum stone color
);
45 void tree_done(struct tree
*tree
);
46 void tree_dump(struct tree
*tree
);
48 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
);
49 void tree_delete_node(struct tree
*tree
, struct tree_node
*node
);
50 void tree_promote_node(struct tree
*tree
, struct tree_node
*node
);
51 bool tree_leaf_node(struct tree_node
*node
);