Page 1 of 1

Book hash keys.

PostPosted: 02 Jul 2008, 08:41
by Fermin Serrano
In order to make and opening book that handle transposition, people make books and store the hash keys of the position. My question is:
how can one store the hash key of the possition if that hash key change between differents executions due to the random generation?
As I understand, th book hash keys must be permanent and the ones people use inside engine are volatile?. What's the trick people use here?

Re: Book hash keys.

PostPosted: 02 Jul 2008, 11:11
by Harald Johnsen
Ppl use hardcoded 'randoms'.
For example engines that can read polyglot books use polyglot randoms (file randoms.cpp)

HJ.

Re: Book hash keys.

PostPosted: 02 Jul 2008, 20:32
by Zach Wegner
Most people use their own (or copied from somewhere) deterministic random number generators. That way the hashkeys are the exact same every time the program is run, and they don't have to be hardcoded.

Re: Book hash keys.

PostPosted: 03 Jul 2008, 09:50
by H.G.Muller
Most pseudo-random--number generators produce identical sequences on every call of the program. They usually come with a 'seed' function with which you can determine where you enter their cycle, but if you don't use it the seed is fixed. If you do use it, you would still have the same sequence on every run, unless you seed it with something variable, like the time of day.

In Joker and Fairy-Max I seed the random generator with the GetTickCounts() function only after generating the Zobrist keys with it. So I could use them to access a book, if I ever decide to implement one.