From: H.G.Muller Date: Tue, 15 Nov 2016 09:27:39 +0000 (+0100) Subject: Fix and improve move choice with learning X-Git-Url: http://winboard.nl/cgi-bin?p=polyglot.git;a=commitdiff_plain;h=a341ac6d5475e4b5e8b9ed947195366416247ee6 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). --- 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]; }