Fix trace in case of space evaluation
authorjoergoster <osterj165@googlemail.com>
Sat, 26 Nov 2016 09:56:24 +0000 (10:56 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 27 Nov 2016 08:28:32 +0000 (09:28 +0100)
We only compute space eval during the opening/early midgame.
Apply the same logic for DoTrace.

No functional change.

src/evaluate.cpp

index 8987b0e..4ce500a 100644 (file)
@@ -888,8 +888,9 @@ Value Eval::evaluate(const Position& pos) {
       Trace::add(IMBALANCE, ei.me->imbalance());
       Trace::add(PAWN, ei.pi->pawns_score());
       Trace::add(MOBILITY, mobility[WHITE], mobility[BLACK]);
-      Trace::add(SPACE, evaluate_space<WHITE>(pos, ei)
-                      , evaluate_space<BLACK>(pos, ei));
+      if (pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK) >= 12222)
+          Trace::add(SPACE, evaluate_space<WHITE>(pos, ei)
+                          , evaluate_space<BLACK>(pos, ei));
       Trace::add(TOTAL, score);
   }