Author: Uri Blass
Date: 02:29:38 06/16/03
Go up one level in this thread
On June 16, 2003 at 04:42:43, Andrei Fortuna wrote: >On June 16, 2003 at 04:30:14, Uri Blass wrote: > >>On June 16, 2003 at 03:47:02, Andrei Fortuna wrote: >> >>>Hi, >>> >>>Recently I have been thinking a lot about game trees. As you might know I have >>>released a free library that can be used with a chess program to output game >>>trees to a file (that later can be viewed/analysed). The solution I came up was >>>along those lines : >>> * call a function to setup position before analysis starts >>> * all search functions need to be modified by adding an extra parameter >>>(node_id of the parent node) >>> * when the engine enters a search node : first thing to do is get a node_id >>>from the library (this way children nodes will always have an id higher than >>>their parents) >>> * when the engine exists a search node it will write the collected data for >>>this node to an output file >>> >>>No extra memory is needed, all nodes are written as they appear ... but it might >>>look a bit complicated at first look. Do you think there is a better way (i.e. >>>simpler in terms in changes that need to be done to the existing chess program) >>>for this task ? >>> >>>Cheers, >>>Andrei >> >>Yes >> >>I believe that it is more simple not to add parameters but only to change >>the makemove function and undomove function and the function to setup position. >> >>Adding parameter means that I need to change all the places when I call >>alphabeta and qsearch and I do not like to do it for the original code if I care >>about speed(adding parameter may do the program slightly slower). >> >>changing only the makemove,undomove and setup position seems more simple and I >>can get rid of it when the program plays a game by the following kind of code >>inside makemove: >> >>#if TREE >>//tell information about move to external program >>... >>#endif > >Ok, but in this case how can you know in makemove/unmakemove: > * the node_id of the parent node (this is needed when you write the node) The external program can calculate the node id. In the beginning I give a position and it is the parent node of the tree that is going to be generated. After it if I call analyze I have a list of make and unmake moves For example in the opening position I may have something like: make a2a3 undo make a2a4 undo make b2b3 undo...make Nh3 undo make e2e4 make a7a6 undo make a7a5 undo. It is easy to understand what is the position at every step based on this information. > * the returned score for the node I think that for this information it is possible to call the external program from the evalute function. > >What if you use makemove/unmake move for something else than calling Search or >QSearch ? I do not see a reason to make move if I do not plan to call search or qsearch after it. There are cases when I decide based on evaluation after the move not to do it(for example if I discover based on evaluation that the position is checkmate) but I still see the move as part of the tree. Uri
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.