bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: makehyper


From: Philippe Michel
Subject: Re: makehyper
Date: Sat, 9 May 2020 23:09:14 +0200

On Sat, May 09, 2020 at 09:55:14AM -0400, Timothy Y. Chow wrote:

> I recently learned about makehyper.  A friend of mine ran it on his 
> computer and it seemed to terminate successfully.  I would like to be able 
> to examine the equities using my own C programs, rather than using them 
> inside GNUBG.  But to do this, I need to understand the format of the 
> database file generated by makehyper, and I haven't been able to find a 
> description of this format anywhere.  Is it easy to describe?

The format of the file is (implicitely) described in the 
StartFromDatabase() function of makehyper.c : a 40 bytes header followed 
by 28 bytes records each encoding 10 values: 5 outputs and 5 equities, 
see the definition of the hyperequity structure at the beginning of the 
file.

Starting from that would probably lead to reinventing the wheel, though. 
Starting from bearoffdump.c seems more promising since it can show the 
content of hypergammon databases, either by index:

% bearoffdump -n 2020 /usr/local/share/gnubg/hyper1.bd

Bearoff database: /usr/local/share/gnubg/hyper1.bd
Position number : 2020

Information about database:

 * On disk 2-sided exact 1-chequer Hypergammon database evaluator
   - generated by GNU Backgammon
   - up to 1 chequers on 25 points (26 positions) per player

Dump of position#: 2020

 GNU Backgammon  Position ID: AAACAAAABAAAAA
 +13-14-15-16-17-18------19-20-21-22-23-24-+     
 |                  |   |                  | OOO 
 |                  |   |                  | OOO 
 |                  |   |                  | OOO 
 |                  |   |                  | OOO 
 |                  |   |                  | OO 
v|                  |BAR|                  |     
 |                  |   |                  | XX 
 |                  |   |                  | XXX 
 |                  |   |                  | XXX 
 |                  |   |                  | XXX 
 |                O | X |                  | XXX 
 +12-11-10--9--8--7-------6--5--4--3--2--1-+     

             Player       Opponent
Position           25            18

Owned cube                    : -0.1276
Centered cube                 : -0.2873
Centered cube (Jacoby rule)   : -0.3066
Opponent owns cube            : -0.3514

 
Or by position ID:

% bearoffdump -p AAACAAAABAAAAA /usr/local/share/gnubg/hyper1.bd

Bearoff database: /usr/local/share/gnubg/hyper1.bd
Position ID     : AAACAAAABAAAAA

Information about database:

 * On disk 2-sided exact 1-chequer Hypergammon database evaluator
   - generated by GNU Backgammon
   - up to 1 chequers on 25 points (26 positions) per player

Dump of position ID: AAACAAAABAAAAA

 GNU Backgammon  Position ID: AAACAAAABAAAAA
 +13-14-15-16-17-18------19-20-21-22-23-24-+     
 |                  |   |                  | OOO 
 |                  |   |                  | OOO 
 |                  |   |                  | OOO 
 |                  |   |                  | OOO 
 |                  |   |                  | OO 
v|                  |BAR|                  |     
 |                  |   |                  | XX 
 |                  |   |                  | XXX 
 |                  |   |                  | XXX 
 |                  |   |                  | XXX 
 |                O | X |                  | XXX 
 +12-11-10--9--8--7-------6--5--4--3--2--1-+     

             Player       Opponent
Position           25            18

Owned cube                    : -0.1276
Centered cube                 : -0.2873
Centered cube (Jacoby rule)   : -0.3066
Opponent owns cube            : -0.3514


bearoffdump.c is a very short file, using functions defined in bearoff.c 
to access the database file.

Doing something similar and linking your program with bearoff.o and 
possibly some other gnubg object files as needed might be the easiest 
solution.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]