From a341ac6d5475e4b5e8b9ed947195366416247ee6 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 15 Nov 2016 10:27:39 +0100 Subject: [PATCH] Fix and improve move choice with learning A new formula is used to recalculate weights when the BookLearn option is on. Unlike the old one, this allows the effective weight to increase by an arbitrarily large factor between a move that always wins and one that always draws (or between one that always draws and one that always loses). --- book.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/book.c b/book.c index 2a939f9..b7ea278 100644 --- a/book.c +++ b/book.c @@ -204,7 +204,7 @@ void book_moves(list_t * list, const board_t * board) { weight[pos - first_pos] = 1000 * (uint32)entry->count; if(option_get_bool(Option,"BookLearn")) // [HGM] improvised use of learn info - weight[pos - first_pos] *= ((uint32)entry->n + 10.) /((uint32)entry->sum + 1.); + weight[pos - first_pos] *= ((uint32)entry->sum + 4.) / (2.*(uint32)entry->n - (uint32)entry->sum + 4.); sum += weight[pos - first_pos]; } -- 1.7.0.4