Polyglot pickBest

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

D Sceviour
Posts: 570
Joined: Mon Jul 20, 2015 5:06 pm

Polyglot pickBest

Post by D Sceviour »

How does one specify the Polyglot book pickBest variable for a tournament? Arena, CuteChess and Winboard do not have a pickBest variable checkbox. Should the pickBest flag be set by the user in an ini file?

An example of pickBest can be found in the source code for "PolyglotBook::probe()" in Stockfish version 4, book.cpp. Later versions of Stockfish seem to have deleted book.cpp. The pickBest flag determines whether the engine will select the best move playable in a Polyglot book, or a random move when several moves might be reasonable.
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Polyglot pickBest

Post by hgm »

WinBoard has a 'Book Variation' setting (in the Common Engine Settings dialog). When you set that to 0 it only picks the move with the highest weight (randomly if there is more than one with that same weight). If it is 50, it plays the moves proprtionally to their weight, if it is 100, it plays all moves in the book with equal probability irrespective of their weight (except if the weight is 0).

The exact implementation is that it raises the weights to the power (100-var)/var, before using them as relative frequency.
D Sceviour
Posts: 570
Joined: Mon Jul 20, 2015 5:06 pm

Re: Polyglot pickBest

Post by D Sceviour »

hgm wrote:WinBoard has a 'Book Variation' setting (in the Common Engine Settings dialog). When you set that to 0 it only picks the move with the highest weight (randomly if there is more than one with that same weight). If it is 50, it plays the moves proprtionally to their weight, if it is 100, it plays all moves in the book with equal probability irrespective of their weight (except if the weight is 0).

The exact implementation is that it raises the weights to the power (100-var)/var, before using them as relative frequency.
That looks like another good reason for using Winboard! :) The 'Book Variation' could simulate various degrees of a binomial distribution for a selective book move.