X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=book_format.html;h=b6d70bb542222e1c0e145d2dafba582d6e730949;hb=d6cc26b9413f723c7436f17363fcc10f64e0746b;hp=c0302823b0bcb3480467b19fd44ccfd03b436549;hpb=64f72f31685ea1dff12b19b22cfaf7a53ccc079f;p=polyglot.git
diff --git a/book_format.html b/book_format.html
index c030282..b6d70bb 100644
--- a/book_format.html
+++ b/book_format.html
@@ -317,7 +317,7 @@ only updated after the appropriate king, rook or castling moves.
-
enpassent
If the opponent has performed a double pawn push
+en passant
If the opponent has performed a double pawn push
and there is now a pawn next to it belonging to the player to move then
"enpassant" is the entry from RandomEnPassant whose offset is the file
of the pushed pawn (counted from 0(=a) to 7(=h)). If this does not
@@ -417,30 +417,44 @@ implementation may for example verify that there is really a king
present on e1/e8.
weight
In the Polyglot source code this field is called "count" but it is in fact
-a measure for the quality of the move. It should be at least one.
+a measure for the quality of the move.
The Polyglot book generator sets it to 2*(wins)+(draws), globally
scaled to fit into 16 bits. A move with a weight of zero is deleted
from the book. This is just a convention and book authors
-are free to set this field according to their taste (as long as it is at least one).
+are free to set this field according to their taste.
If random play is enabled in Polyglot then the probability that
a move is selected is its weight divided by the sum of the weights
of all the moves in the given position.
+In XBoard, which also supports Polyglot books, the weight can be raised
+to a power N (0 <= N <= infinity) before doing the probability calculation,
+enhancing or completely destroying the effect of the weights.
A note on zero weights
-Polyglot assumes that weights are at least one since a zero
-weight means the move should not be played, and hence you might as
-well delete the entry from the book (which the Polyglot book generator does).
+Note that older Polyglot versions are defective as to the use of zero weights,
+(meaning the move should never be played),
+and crash when they encounter them.
+This because of a misplaced internal consistency check,
+which really only made sense during book building
+(wich deletes all entries with zero weight from the book).
-Nonetheless, if you really insist, an entry with zero weight can be
-approximated by giving it very low probability. This is what Scid does.
+Yet hand-tuning of a book often leads to the desire to completely disable a move,
+without deleting it. Some software approximates an entry with zero weight
+by giving it very low probability. This is for instance what Scid does,
+but it means the move will still occasionally be played.
+With XBoard you can edit Polyglot books to set the weight to exactly zero,
+as well as delete or add moves.
learn
"learn" is set to zero by the Polyglot book generator.
If you set "BookLearn=true" in polyglot.ini then this field
-is used to record learning information. However I do not know of any
-program that uses this information. Also this means the Polyglot should
+is used to record learning information. From Polyglot 2.0 on, Polyglot
+can also use this learn information for modulating the playing probabilities
+of the book moves, based on how often they were played and with
+how much success they met. To use this feature Polyglot should
have write access to the opening book which on Unix systems will probably
not be the case if the book has been installed centrally.
+Note that for the book to be opened for write access, the option
+BookLearn will have to be set before the book file is specified!
Sample code
The following sample code is released in the public domain.
@@ -515,8 +529,76 @@ b=1,c=2,d=3,e=4,f=5,g=6.
(see above) in which the "from square" is the position of the king and
the "to square" is the position of the rook. This is to maintain
compatibility with various Fruit derivatives.
-