On Jan 18, 2009, at 5:38 PM, Magnus Persson wrote:

In Valkyria I solved this by playing out the ladder on the playout board, and store all changes on a stack. When the ladder undos moves it just pop changes from the stack. In this way I can also use the rich board representation of Valkyria to setup the ladder fast. The drawback is that the code is ugly and slightly buggy when stones are sacrificed during the search.

A todo thing is to write a more correct ladder reader that still uses the idea of sharing the array with board with the playout, so that no copying has to be done.


My ladder code re-uses the board array of the playout module. But copying this array before reading a ladder doesn't slow things down all that much. As has been discussed on this list elsewhere, copying an array is fast nowadays. Re-using the array is actually a way to make sure your ladder-reading is without bugs when doing undo. If something goes wrong you notice immediately...

Maybe what David alluded to is that the playout has no undo so he can't use it to play and undo moves during ladder search. In my case the ladder reader only needs an array with the position. For the rest it's completely self-contained. That adds maybe a little bit when setting up the ladder reading, but it's still fast.

Mark


-Magnus

Quoting David Fotland <fotl...@smart-games.com>:

I think it is too expensive to read ladders during playouts. I remember that you have faster ladders search code so it might not cost you as much. My playout code has no ability to undo a move or do any kind of lookahead.

David


--
Magnus Persson
Berlin, Germany
_______________________________________________
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