On Sun, Jun 27, 2010 at 12:23:08PM -0400, Álvaro Begué wrote:
> There is a pretty fast way to do this: You have a non-normalized probability
> per square (this means they don't have to add up to 1), and you also keep
> track of the sum of the probabilities in each row, and also the total
> probability. Now you through a number between 0 and the total probability.
> Go row by row, subtracting the probability of the row from the random
> number. When the number would become negative, it means you found your row.
> So now go square by square in that row, subtracting the individual
> probabilities from the number. When it would become negative, you found your
> move.

Yes, that is the common method, I think. Still, it is *quite*
a slowdown, especially on 19x19.

> Precision is a tricky issue to deal with when implementing this. John Tromp
> and I resorted to using integers as probabilities to avoid precision
> problems.

Yes, precision is one thing I find tricky handling. I can't quite
imagine using integers right now, though. Do you mean doing fixed-point
arithmetic by that?

-- 
                                Petr "Pasky" Baudis
The true meaning of life is to plant a tree under whose shade
you will never sit.
_______________________________________________
Computer-go mailing list
[email protected]
http://dvandva.org/cgi-bin/mailman/listinfo/computer-go

Reply via email to