bug-gnubg
[Top][All Lists]
Advanced

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

Re: [Bug-gnubg] Small oddity in CalculateHalfInputs()


From: Jim Segrave
Subject: Re: [Bug-gnubg] Small oddity in CalculateHalfInputs()
Date: Wed, 18 May 2005 17:13:04 +0200
User-agent: Mutt/1.4.2.1i

On Wed 18 May 2005 (08:06 +0100), Jon Kinsey wrote:
> Jim Segrave wrote:
> >I've been looking at this function as I belive it can be recoded to
> >provide more efficient setup of the NN inputs. As a first step, I've
> >been going through the code looking at the sections that produce
> >various inputs. One of the very first ones is the routine to calculate
> >the number of pips needed to break contact:
> >
> >
> >  n = 0;
> >  for( i = nOppBack + 1; i < 25; i++ )
> >    if( anBoard[ i ] )
> >      n += ( i + 1 - nOppBack ) * anBoard[ i ];
> >
> >here nOppBack is the point number (-1 = bar, 0..23) of the opponent's
> >chequer which is farthest back (and hence has to be passed before
> >contact is broken). The problem is, that when there is a piece on the
> >bar, this caluclation comes up with the pip count needed to bearoff
> >each chequer +1. For example, if the side being evaluated had only one
> >chequer on the 6 point, and the opponent had a chequer on the bar, the
> >correct break contact value is 6, but this routine comes up with
> >7. This can lead to a significant discrepancy of 15 when the side
> >being evaluated hasn't yet borne anything off. I don't know what the
> >overall effect would be, but I thought I'd point it out. I assume any
> >replacement for CalculateHalfInputs will need to replicate this
> >behaviour, as otherwise the nets would need retraining.
> 
> I think the code might be ok.  E.g.
> 
> nOppBack = -1 (bar), i = 5 (6 pt) gives:
> i + 1 - nOppBack = 7

No, 6 points breaks contact - you don't have to go any further than
off.

> now if instead nOppBack = 0 (1 pt) gives:
> nOppBack = 0 (1 pt), i = 5 (6 pt) gives:
> i + 1 - nOppBack = 6

Breaking contact with a man on the 1 is no different than with the man
on the bar, you only break contact by bearing off

> and if instead nOppBack = 4 (5 pt) gives:
> nOppBack = 4 (5 pt), i = 5 (6 pt) gives:
> i + 1 - nOppBack = 2

which is correct, you only need to reach the 4 point

> It's a bit confusing though so perhaps I've misunderstood the problem.

-- 
Jim Segrave           address@hidden




reply via email to

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