This is a good question. In my sample code only non-captures (other than the first one in any node) are able to define an analog. but they would always use the tree of previously search non-capture at that node as such. So it might be different for every move at ply 1, although in practice it might be the same (because the analog indeed worked perfectly, so that it did not have to be amended by searching alternative moves).tpetzke wrote:How is the analogy key updated ? Once you have obtained a first analogy key probably at ply 1 it is never changed again. Is this intended ?
But you are right: once an analog is picked, it would never be changed deeper into the tree. So I guess that in practice there should be some evaluation on how well the tree worked, and abandon it when it doesn't (so you can pick another at a deeper level).
E.g. when move A from the root was searched, and another move B from there decided to use the A-tree as a template for the B tree... When after searching the first move of the node after B (say C) you get to search move D there, you have the choice:
1) use the sub-tree hanging from A-D as analog (i.e. stick to the ply-1 analog).
2) use the sub-tree hanging from B-C (if C and D were judged 'similar').
Both the analog candidates would differ in only a single move from the current path B-D (A in stead of B, or C in stead of D), and this is tpical for the entire idea. But when the A-C tree worked poorly for B-C, it would probably be a good idea to discard the A-tree as analog, and use the B-C tree rather than the A-D tree as analog for B-D.