From: Fabian Fichter Date: Sat, 1 Sep 2018 09:26:59 +0000 (+0200) Subject: Tweak tempo value for drop variants X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=4e739769c6874c51c59af7191ebd4c109594c7e1;p=fairystockfish.git Tweak tempo value for drop variants STC crazyhouse LLR: 2.95 (-2.94,2.94) [0.00,10.00] Total: 773 W: 436 L: 324 D: 13 http://35.161.250.236:6543/tests/view/5b8a5cb16e23db0fbab0dd15 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 2ce7aec..a0d34be 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -977,12 +977,19 @@ namespace { } return (pos.side_to_move() == WHITE ? v : -v) // Side to move point of view - + Eval::Tempo; + + Eval::tempo_value(pos); } } // namespace +/// tempo_value() returns the evaluation offset for the side to move + +Value Eval::tempo_value(const Position& pos) { + return Tempo * (1 + 4 * pos.captures_to_hand()); +} + + /// evaluate() is the evaluator for the outer world. It returns a static /// evaluation of the position from the point of view of the side to move. diff --git a/src/evaluate.h b/src/evaluate.h index ccc6d5f..9b444ca 100644 --- a/src/evaluate.h +++ b/src/evaluate.h @@ -34,6 +34,7 @@ constexpr Value Tempo = Value(20); // Must be visible to search std::string trace(const Position& pos); +Value tempo_value(const Position& pos); Value evaluate(const Position& pos); } diff --git a/src/search.cpp b/src/search.cpp index 04c5393..1b79a9d 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -714,7 +714,7 @@ namespace { { ss->staticEval = eval = (ss-1)->currentMove != MOVE_NULL ? evaluate(pos) - : -(ss-1)->staticEval + 2 * Eval::Tempo; + : -(ss-1)->staticEval + 2 * Eval::tempo_value(pos); tte->save(posKey, VALUE_NONE, BOUND_NONE, DEPTH_NONE, MOVE_NONE, ss->staticEval, TT.generation()); @@ -1283,7 +1283,7 @@ moves_loop: // When in check, search starts from here else ss->staticEval = bestValue = (ss-1)->currentMove != MOVE_NULL ? evaluate(pos) - : -(ss-1)->staticEval + 2 * Eval::Tempo; + : -(ss-1)->staticEval + 2 * Eval::tempo_value(pos); // Stand pat. Return immediately if static value is at least beta if (bestValue >= beta)