4 /* "Liberty map" - description of a particular liberty structure of a group.
5 * The idea is that we can use this as a hash index to track local tactical
6 * effectivity of various moves within the particular liberty structure
16 #define LM_DEBUG if (0)
19 /* Computation and representation of the libmap hash. */
21 hash_t
group_to_libmap(struct board
*b
, group_t group
);
24 /* Set of moves ("libmap context") grouped by libmap, with some statistics. */
25 /* Hash structure storing info about move effectivity. */
29 struct move_stats stats
;
32 struct libmap_context
{
35 /* We add moves in multiple threads. But at most, on conflict we will
36 * end up with tiny amount of misappropriated playouts. */
38 struct libmap_move move
[GROUP_REFILL_LIBS
];
41 /* Get statistics of particular move in given libmap structure. */
42 static struct move_stats
*libmap_move_stats(struct libmap_context
*lc
, struct move move
);
45 static inline struct move_stats
*
46 libmap_move_stats(struct libmap_context
*lc
, struct move move
)
49 for (int i
= 0; i
< lc
->moves
; i
++) {
50 if (lc
->move
[i
].move
.coord
== move
.coord
51 && lc
->move
[i
].move
.color
== move
.color
)
52 return &lc
->move
[i
].stats
;