UCB1AMAF: Add RAVE support
[pachi/peepo.git] / playout.h
blob7ea82824a5e1b429e799701574b79aeb5da6dba2
1 #ifndef ZZGO_PLAYOUT_H
2 #define ZZGO_PLAYOUT_H
4 struct board;
5 struct move;
6 enum stone;
9 struct playout_policy;
10 typedef coord_t (*playoutp_choose)(struct playout_policy *playout_policy, struct board *b, enum stone my_color);
11 /* 0.0 - 1.0; can return NAN is policy has no opinion */
12 typedef float (*playoutp_assess)(struct playout_policy *playout_policy, struct board *b, struct move *m);
14 struct playout_policy {
15 int debug_level;
16 /* We call choose when we ask policy about next move.
17 * We call assess when we ask policy about how good given move is. */
18 playoutp_choose choose;
19 playoutp_assess assess;
20 void *data;
24 /* Record of the random playout - for each intersection:
25 * S_NONE: This move was never played
26 * S_BLACK: This move was played by black first
27 * S_WHITE: This move was played by white first
29 struct playout_amafmap {
30 enum stone *map; // [b->size2]
34 /* 1: starting_color wins, 0: starting_color loses
35 * -1: superko inside the game tree */
36 int play_random_game(struct board *b, enum stone starting_color, int gamelen, struct playout_amafmap *amafmap, struct playout_policy *policy);
38 #endif