]> git.sesse.net Git - stockfish/commitdiff
Dynamic draw value
authorJoerg Oster <osterj165@googlemail.com>
Wed, 26 Feb 2014 18:32:19 +0000 (19:32 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 26 Feb 2014 18:33:52 +0000 (19:33 +0100)
Try to avoid repetition draws at early midgame,
this should give an edge against weaker opponents
and reduce draw rate.

Tested for regressions with SPRT[-3, 1] and
passed both short TC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 68498 W: 12928 L: 12891 D: 42679

And long TC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 40212 W: 6386 L: 6295 D: 27531

bench: 7990513

src/search.cpp

index c84ad24b2a8b99b0993904e017ff53d17fdb0123..668fd0955687523cd8d8779dccb1c65aea64e6fb 100644 (file)
@@ -206,10 +206,10 @@ void Search::think() {
       }
   }
 
       }
   }
 
-  if (Options["Contempt Factor"] && !Options["UCI_AnalyseMode"])
+  if (!Options["UCI_AnalyseMode"])
   {
   {
-      int cf = Options["Contempt Factor"] * PawnValueMg / 100; // From centipawns
-      cf = cf * Material::game_phase(RootPos) / PHASE_MIDGAME; // Scale down with phase
+      // Dynamic draw value: try to avoid repetition draws at early midgame
+      int cf = std::max(70 - RootPos.game_ply(), 0);
       DrawValue[ RootColor] = VALUE_DRAW - Value(cf);
       DrawValue[~RootColor] = VALUE_DRAW + Value(cf);
   }
       DrawValue[ RootColor] = VALUE_DRAW - Value(cf);
       DrawValue[~RootColor] = VALUE_DRAW + Value(cf);
   }