Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question about removing double positions in book.

Author: Uri Blass

Date: 08:22:36 05/23/04

Go up one level in this thread


On May 23, 2004 at 11:09:07, Robert Hyatt wrote:

>On May 23, 2004 at 10:58:50, Uri Blass wrote:
>
>>I guess that crafty does not have the same position more than once in its book
>>but the same position can happen in many games and I do not see where it removes
>>doubles.
>
>It sorts the hash signatures, merges the book, and then squeezes out duplicates,
>but it counts them so that it knows how many times the move was played (by how
>many times the duplicate hash signature is in the original file).
>
>
>>
>>I guess that the steps for building a book:
>>1)building a book based on games when the same position may appear a lot of
>>times.
>>2)Sorting the book so the positions are ordered by lexisographic order.
>>3)deleting double from the book
>>4)copying the book that remains to a file.
>>
>>What function in Crafty is responsible for 3?
>
>It is in bookup.c:
>
>      if (current.position == next.position) {
>        current.status_played = current.status_played | next.status_played;
>        played++;
>        if (temp.status & 128 && temp.percent_play & 128)
>          wins++;
>        if (temp.status & 128 && !(temp.percent_play & 128))
>          losses++;
>        if (temp.status & 32 && !(temp.percent_play & 128))
>          wins++;
>        if (temp.status & 32 && temp.percent_play & 128)
>          losses++;
>
>That is what happens when the next position signature is the same as the current
>(a duplicate)...

Thanks.

I see now and it was simply not in the place that I expected it before copying
the array to a file.

I thought that it may be better to work more on arrays and less on files because
working on arrays is faster but I agree that it is not important when the task
is done only one time.

Uri



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.