You have the most control with option 1. You can implement this fast
by keeping the sum of the weights for each row and for the total
board. You then "roll" a number between 0 and total_weight, and
advance through the rows subtracting the probability of each row until
you would cross 0, then go along the row subtracting the probability
of each point, until you would cross zero. Pick the point where the
process ends.

I initially implemented a similar scheme using a binary tree, and I
think it was Rémi who told me about this method, which is simpler and
faster in practice.

You may have problems with floating-point precission doing this. The
easy solution is using integers for weights, but perhaps there are
ways to make the code robust while keeping the more natural
floating-point values.


Álvaro.


On Mon, May 4, 2009 at 2:25 PM, Isaac Deutsch <i...@gmx.ch> wrote:
> Hello,
>
> I'm about to work on heavy playouts, and I'm not sure how to choose a move
> during the playout. I intend to have weights for various features. I thought
> about 3 versions:
>
> 1. In a position, calculate all the weights and the total weight. Then, play
> one move i with the probability weight_i/total_weight.
>
> 2. Select a move randomly. Calculate the weight of it, then squash that
> weight in the [0,1] range. Play that move with that "probability".
>
> 3. Same as 2., but play that move if the "probability" is higher than a
> certain treshold.
>
> Which one do you think works best? I'm looking forward to other ideas, too. :)
>
> -Isaac
> --
> Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss 
> für nur 17,95 Euro/mtl.!* 
> http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a
> _______________________________________________
> computer-go mailing list
> computer-go@computer-go.org
> http://www.computer-go.org/mailman/listinfo/computer-go/
>
_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/

Reply via email to