1 #ifndef ZZGO_UCT_PRIOR_H
2 #define ZZGO_UCT_PRIOR_H
16 /* [board_size2(b)] array, move_stats are the prior
17 * values to be assigned to individual moves;
18 * move_stats.value is not updated. */
19 struct move_stats
*prior
;
20 /* [board_size2(b)] array, whether to compute
21 * prior for the given value. */
25 /* Wins can be negative to give losses; passing 0 wins is undefined. */
26 static void add_prior_value(struct prior_map
*map
, coord_t c
, int wins
, int playouts
);
28 void uct_prior(struct uct
*u
, struct tree_node
*node
, struct prior_map
*map
);
32 add_prior_value(struct prior_map
*map
, coord_t c
, int wins
, int playouts
)
34 map
->prior
[c
].playouts
+= playouts
;
37 int w
= wins
* map
->parity
;
38 if (w
< 0) w
+= playouts
;
40 map
->prior
[c
].wins
+= w
;