On Mon, Nov 12, 2007 at 08:45:14PM +0100, Heikki Levanto wrote:
> On Mon, Nov 12, 2007 at 06:10:21PM +0100, Petr Baudis wrote:
> > Sorry, it's http://repo.or.cz/w/zzgo.git
> 
> I've had a quick look at it, and have already two comments:
> 
> 1) You seem to use struct {x,y} for coordinates all the way. I think using a
> single int is usually faster. I was involved with GNU Go when we made that
> change, and it did make sense. Gives some speed, but costs a bit of work, and
> some readability.

Thanks for the tip, I will have a look at it.

> 2) It looks like your montecarlo algorithm tries to pick random points and
> discards those that are not empty or legal to play in. It ought to be faster
> to make a list of legal points in advance (or at least empty ones), and pick
> from that list. This list can be maintained incrementally during the MC
> simulation.

I have rewritten it so that it now picks a random point at the board,
then searches the whole board starting from that point and picks up the
first valid point.

I guess this is pretty much equivalent to what you suggested?

Incrementally maintaining cache of legal points would be probably huge
win, but seems very hard to do to me. Anyway, the most time-consuming
part is maintenance of liberty count for all the groups.

> Still, I like your style, and may yet decide to take advantage of your
> library instead of LibEGO at least in some of my experiments.

In the meantime I have moved random move generator to the board library
(and it's much faster now, apparently speeding up random games playing
from 2500 to 3500 - wow), and converted the example monte carlo engine
to use total number of moves instead of per move candidate.

It's interesting how the latter completely changed the playing style of
the bot. Before, it used to play very solid moves and liked very much to
crawl around the board. It usually ended up making a chain of stones in
the middle of the board, then running out of eyespace. Now it jumps
around much wilder.


Does any frequently playing real-world bot use libEGO? It seems still
order of magnitude faster, but it looks like that is because it
simplifies some things too much. For example, its board::merge_chains()
does not seem to take account for merging chains that might have had
liberties in common. But maybe I just overlooked something?

-- 
                                Petr "Pasky" Baudis
We don't know who it was that discovered water, but we're pretty sure
that it wasn't a fish.          -- Marshall McLuhan
_______________________________________________
computer-go mailing list
[email protected]
http://www.computer-go.org/mailman/listinfo/computer-go/

Reply via email to