This code should work with "r -= weights[i++]" in the loop body, and comes down
to a linear search through
cumulative sum of the weights. If the weights will be static for a number of
selections, you can store the
cumulative weights in an array and use binary search for selecting the move.
So
On Wed, Jul 15, 2009 at 11:37 PM, David Fotland wrote:
> So many complex ideas :) Why not just multiply the weight of each pattern
> by a random number and pick the biggest result?
This is fine if you are looking for the slowest algorithm you can find.
But it does have the merit of being straig
In the loop i is always zero. I think your code is wrong.
You probably meant to loop over all the weights (or I should say on average
half the weights), and this code is slow if there are a lot of weights.
2009/7/16 Peter Drake
> I must be missing something. Isn't the obvious trick:
> int r
I must be missing something. Isn't the obvious trick:
int r = random();
int i = 0;
while (r > weights[i]) {
r -= weights[i];
}
return i;
This way, you only have to generate one random number.
Peter Drake
http://www.lclark.edu/~drake/
On Jul 15, 2009, at 8:55 PM, Zach Wegner wrote:
O
On Wed, Jul 15, 2009 at 10:37 PM, David Fotland wrote:
> So many complex ideas :) Why not just multiply the weight of each pattern
> by a random number and pick the biggest result?
>
> David
That involves generating N random numbers and then doing N-1
comparisons. The n-ary tree has only 1 random
You would only do this for patterns that match in a position. For Many
Faces that is typically a few dozen. Many Faces only has about 1800 total
patterns in its go knowledge base. Playouts use Mogo patterns, about a
dozen total.
David
> -Original Message-
> From: computer-go-boun...@co
> So many complex ideas :) Why not just multiply the weight of each pattern
> by a random number and pick the biggest result?
Good for 5 patterns, not so good for 5000 patterns.
Darren
___
computer-go mailing list
computer-go@computer-go.org
http://ww
So many complex ideas :) Why not just multiply the weight of each pattern
by a random number and pick the biggest result?
David
> -Original Message-
> From: computer-go-boun...@computer-go.org [mailto:computer-go-
> boun...@computer-go.org] On Behalf Of Mark Boon
> Sent: Wednesday, July
I think you could do this with a binary tree - at each node keep a total of
the weight values of the subtree below the node.
If the pattern was hashed, then each bit could define a branch of the tree,
0 = left branch 1 = right branch.
Then you have a very simple divide and conquer algorithm. Th
If your weights are all between 0 and 1:
do
double r = rand(0 to 1)
int i = rand(0 to weightCount - 1)
until weight[i] > r
I think that's right.
Mark Boon wrote:
When using patterns during the playout I had improvised some code to
select patterns randomly, but favour those with higher w
You might look in the genetic algorithm literature, where they have to
do this for fitness-proportional reproduction. A useful buzzword is
"roulette wheel".
Peter Drake
http://www.lclark.edu/~drake/
On Jul 15, 2009, at 4:06 PM, Mark Boon wrote:
When using patterns during the playout I ha
> 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
On this list I've heard of row sums. You scan by row subtracting
weights and then scan by column adding weight... Each time looking for
zero crossings.
Sent from my iPhone
On Jul 15, 2009, at 7:06 PM, Mark Boon wrote:
When using patterns during the playout I had improvised some code to
se
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..
I was wondering though if there's an established algorithm for
something like this. To be a little more precise, if I have
thaoeuns at gmail.com wrote:
> So changing the komi doesn't actually improve your confidence
> interval. If (as Darren said) the win percentage is a crude
> estimate of the final score, then changing komi would do nothing
> to change the results one got (and at extremes biases it badly).
> Movin
On Wed, Jul 15, 2009 at 9:41 AM, Carter Cheng wrote:
> Where can I find information on these bridging protocols or are libraries
> provided for this (to the 9x9 & 19x19 servers)?
The CGOS protocol is pretty easy to decode from the cgos client script which
is written in TCL. Even if you don't k
For KGS, there is kgsgtp.jar, CGOS provides scripts that connect your
engine to the server, too.
Am 15.07.2009 um 15:41 schrieb Carter Cheng:
Where can I find information on these bridging protocols or are
libraries provided for this (to the 9x9 & 19x19 servers)?
--- On Wed, 7/15/09, Hell
Where can I find information on these bridging protocols or are libraries
provided for this (to the 9x9 & 19x19 servers)?
--- On Wed, 7/15/09, Hellwig Geisse wrote:
> From: Hellwig Geisse
> Subject: Re: [computer-go] gtp which version to implement?
> To: "computer-go"
> Date: Wednesday, July
On Wed, 2009-07-15 at 11:24 +0200, Urban Hafner wrote:
> Carter Cheng wrote:
> > Thanks everyone for the help thus far. I have been looking at the GTP
> protocol page and I am curious which version of the protocol I should
> try to implement if I want to communicate with the servers. Should I be
>
Carter Cheng wrote:
Thanks everyone for the help thus far. I have been looking at the GTP protocol
page and I am curious which version of the protocol I should try to implement
if I want to communicate with the servers. Should I be looking at the GTP 2.0
draft version?
You should implement (
Thanks everyone for the help thus far. I have been looking at the GTP protocol
page and I am curious which version of the protocol I should try to implement
if I want to communicate with the servers. Should I be looking at the GTP 2.0
draft version?
Thanks in advance,
Carter.
21 matches
Mail list logo