> When using patterns during the playout I had improvised some code to
> select patterns randomly, but favour those with higher weights more or
> less proportionally to the weight..

How many patterns, and are the weights constant for the whole game?

If relatively few, and constant, you can make a lookup table (with e.g.
1024 entries) where the number of entries for each pattern is
proportional to its weight. You then choose with a 0..1023 random number.

When more patterns, but only a few distinct weights you can split them
into buckets. E.g. a bucket of weight 1 patterns, weight 1.5 patterns,
weight 2 patterns, etc. The weight of each bucket is the number of
patterns in it times the pattern weight. You first choose a bucket (e.g.
using the above lookup table algorithm), then choose uniformly from
within the bucket.

Darren

P.S.  I suspect you have already came up with the above algorithms. I
had the same question before, and like you realized it wasn't quite as
easy as I thought it would be. I'd also like to hear what the standard
computer science approach is, if there is one. (I just saw Jason's
reply; do you have a good reference describing "row sum" in more detail?)


-- 
Darren Cook, Software Researcher/Developer
http://dcook.org/gobet/  (Shodan Go Bet - who will win?)
http://dcook.org/mlsn/ (Multilingual open source semantic network)
http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)
_______________________________________________
computer-go mailing list
[email protected]
http://www.computer-go.org/mailman/listinfo/computer-go/

Reply via email to