UCT Prior: Add ko prior, by default 0
[pachi.git] / uct / internal.h
blob3e5dbf08a67d831d7bb2bd3e9e05c1afcc673823
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, playout_amaf_nakade;
24 bool amaf_prior;
25 int playout_amaf_cutoff;
26 int dumpthres;
27 int threads;
28 int force_seed;
29 bool no_book;
31 /* Equivalent experience for prior knowledge. MoGo paper recommends
32 * 50 playouts per source; in practice, esp. with RAVE, about 6
33 * playouts per source seems best. */
34 int eqex, even_eqex, gp_eqex, policy_eqex, b19_eqex, cfgd_eqex, eye_eqex, ko_eqex;
36 struct uct_policy *policy;
37 struct tree *t;
38 struct playout_policy *playout;
41 #define UDEBUGL(n) DEBUGL_(u->debug_level, n)
44 typedef struct tree_node *(*uctp_choose)(struct uct_policy *p, struct tree_node *node, struct board *b, enum stone color);
45 typedef struct tree_node *(*uctp_descend)(struct uct_policy *p, struct tree *tree, struct tree_node *node, int parity, bool allow_pass);
46 typedef void (*uctp_prior)(struct uct_policy *p, struct tree *tree, struct tree_node *node, struct board *b, enum stone color, int parity);
47 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);
49 struct uct_policy {
50 struct uct *uct;
51 uctp_choose choose;
52 uctp_descend descend;
53 uctp_update update;
54 uctp_prior prior;
55 bool wants_amaf;
56 void *data;
59 #endif