X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=1b2defa54662a34718bb46c79e40ae9abffbe595;hp=22c17173c5727cd016a0bca109f7c2f62cc9c3a7;hb=d23454854e72e1311363a8c98cd58a5d44c427f9;hpb=2097cd12217a0e18c59bd88424ca613572e6feb2 diff --git a/src/position.cpp b/src/position.cpp index 22c17173..1b2defa5 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1151,6 +1151,11 @@ int Position::see(Move m) const { return do_see(m, 0); } +/// Position::see_asymm() takes tempi into account. +/// If the side who initiated the capturing sequence does the last capture, +/// he loses a tempo. In this case if the result is below asymmThreshold +/// the capturing sequence is considered bad. + int Position::see_asymm(Move m, int asymmThreshold) const { return do_see(m, asymmThreshold); @@ -1234,13 +1239,15 @@ int Position::do_see(Move m, int asymmThreshold) const { } while (stmAttackers); - // FIXME: Document + // If we are doing asymmetric SEE evaluation and the same side does the first + // and the last capture, he loses a tempo and gain must be at least worth "asymmThreshold". + // If not, we replace the score with a very low value, before negamaxing. if (Asymmetric) { - for (int i = 0; i < slIndex ; slIndex += 2) + for (int i = 0; i < slIndex ; i += 2) { - if (swapList[slIndex] < asymmThreshold) - swapList[slIndex] = - QueenValueMg * 16; + if (swapList[i] < asymmThreshold) + swapList[i] = - QueenValueMg * 16; } }