uct_playout(): node_color -> next_color in leaf node processing
[pachi.git] / uct / internal.h
blobbd725a6b35c80befbff4e57cd3b8ad1e4cd865e9
1 #ifndef ZZGO_UCT_INTERNAL_H
2 #define ZZGO_UCT_INTERNAL_H
4 #include "debug.h"
5 #include "move.h"
6 #include "playout.h"
8 struct tree;
9 struct tree_node;
10 struct uct_policy;
12 /* Internal UCT structures */
15 /* Internal engine state. */
16 struct uct {
17 int debug_level;
18 int games, gamelen;
19 float resign_ratio;
20 float loss_threshold;
21 int expand_p;
22 int radar_d;
23 bool playout_amaf;
24 int dumpthres;
25 int threads;
26 int force_seed;
28 struct uct_policy *policy;
29 struct tree *t;
30 struct playout_policy *playout;
33 #define UDEBUGL(n) DEBUGL_(u->debug_level, n)
36 typedef struct tree_node *(*uctp_choose)(struct uct_policy *p, struct tree_node *node, struct board *b, enum stone color);
37 typedef struct tree_node *(*uctp_descend)(struct uct_policy *p, struct tree *tree, struct tree_node *node, int parity, bool allow_pass);
38 typedef void (*uctp_prior)(struct uct_policy *p, struct tree *tree, struct tree_node *node, struct board *b, enum stone color, int parity);
39 typedef void (*uctp_update)(struct uct_policy *p, struct tree *tree, struct tree_node *node, enum stone node_color, enum stone player_color, struct playout_amafmap *amaf, int result);
41 struct uct_policy {
42 struct uct *uct;
43 uctp_choose choose;
44 uctp_descend descend;
45 uctp_update update;
46 uctp_prior prior;
47 bool wants_amaf;
48 void *data;
51 #endif