Tweak tempo value for drop variants
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 1 Sep 2018 09:26:59 +0000 (11:26 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 2 Sep 2018 09:13:11 +0000 (11:13 +0200)
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

src/evaluate.cpp
src/evaluate.h
src/search.cpp

index 2ce7aec..a0d34be 100644 (file)
@@ -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.
 
index ccc6d5f..9b444ca 100644 (file)
@@ -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);
 }
 
index 04c5393..1b79a9d 100644 (file)
@@ -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)