bug-gnubg
[Top][All Lists]
Advanced

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

Re: [Bug-gnubg] evaluation


From: Jim Segrave
Subject: Re: [Bug-gnubg] evaluation
Date: Mon, 28 Jan 2008 22:40:52 +0100
User-agent: Mutt/1.5.16 (2007-06-09)

On Sun 27 Jan 2008 (23:36 +0100), Wojciech Zaremba wrote:
> I have 3 questions:
> 1. How to read what is in structure TanBoard, movelist?

from lib/gnubg-types.h:

typedef int TanBoard[2][25];

there are two arrays of ints, one for player 0 and one for player 1. 
Each has 25 ints, representing the number of his pieces that playerX
has on points 1-24 and the bar (if player 1 has 3 of his pieces on his
6 point, then anBoard[1][5] == 3)

from eval.h:
typedef struct {
    unsigned int cMoves; /* and current move when building list */
    unsigned int cMaxMoves, cMaxPips;
    int iMoveBest;
    float rBestScore;
    move* amMoves;
} movelist;


cMoves is the number of moves in this list (the dimension of the array
of moves pointed to by amMoves

cMaxMoves is the number of partial moves that can be made (0..4) 

0 - no move is possible 
1 - only a single chequer can be moved for only a single one of the die
2 - two chequers can be moved or one chequer can move twice

cMaxPips - the larges number of pips which can be used by a legal move

int 1MoveBest - the index of the best move in the array pointed to by amMoves

float rBestScore - the equity of the best move

amMoves - pointer to array of moves


> 2. How exacly works function FindnSaveBestMoves (it is in file
     eval.c)?

Um - I'm not sure what your question is. 

The function begins by building a list of all possible moves, 

It then runs a for loop over the plies you have asked for.

Within the loop, for each move in the list, it evaluates the equity of
the resulting position. It then applies the move filter to trim the
list down to only the best moves - it keeps up to the value of 'Always
keep' moves, then if there are remaining moves with an equity within
'Moves within' of the best move, it keeps up to 'Add extra' of those.
Then it does the next ply or plies. Moves which have been discarded by
a filter for a later ply are still in the move list with the equity
determined at the ply where they were dropped by the filter.

At the end of the loop, it makes sure that the best moves have been
evaluated at the chosen number of plies (if only one move survived the
0 ply filters, the loop over plies would have exited early and that
move would not have been evaluated any further).

Finally it ensures that the move actually made (if there is one) has
also been evaluated at the appropriate number of plies. It then
returns the move list with the moves which have survived the filter
and (if there is one and it's not a survivor), the actual move made.

> 3. What is diffrent between evaluation of cubedecision and chequerplay?
> Thanks for all.

For a cube decision, you need to evaluate all the possible rolls, so
the move list starts off very big, whereas for a chequer play
evaluation, you start with only the legal moves for that dice
roll. Also you have to look at both the not doubled and doubled
possibilities for each move.

-- 
Jim Segrave           address@hidden






reply via email to

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