Book hash keys.

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Book hash keys.

Postby Fermin Serrano » 02 Jul 2008, 08:41

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?
User avatar
Fermin Serrano
 
Posts: 72
Joined: 10 Apr 2008, 18:20
Location: Madrid (Spain)

Re: Book hash keys.

Postby Harald Johnsen » 02 Jul 2008, 11:11

Ppl use hardcoded 'randoms'.
For example engines that can read polyglot books use polyglot randoms (file randoms.cpp)

HJ.
User avatar
Harald Johnsen
 
Posts: 43
Joined: 20 Aug 2007, 17:01
Location: France

Re: Book hash keys.

Postby Zach Wegner » 02 Jul 2008, 20:32

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.
User avatar
Zach Wegner
 
Posts: 182
Joined: 26 Sep 2004, 22:02
Location: Austin, Texas, USA

Re: Book hash keys.

Postby H.G.Muller » 03 Jul 2008, 09:50

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.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 22 guests