RootColor = RootPos.side_to_move();
TimeMgr.init(Limits, RootPos.game_ply(), RootColor);
+ // 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);
+
if (RootMoves.empty())
{
RootMoves.push_back(MOVE_NONE);
}
}
- if (Options["Contempt Factor"] && !Options["UCI_AnalyseMode"])
- {
- int cf = Options["Contempt Factor"] * PawnValueMg / 100; // From centipawns
- cf = cf * Material::game_phase(RootPos) / PHASE_MIDGAME; // Scale down with phase
- DrawValue[ RootColor] = VALUE_DRAW - Value(cf);
- DrawValue[~RootColor] = VALUE_DRAW + Value(cf);
- }
- else
- DrawValue[WHITE] = DrawValue[BLACK] = VALUE_DRAW;
-
if (Options["Write Search Log"])
{
Log log(Options["Search Log Filename"]);
&& !ss->skipNullMove
&& abs(beta) < VALUE_MATE_IN_MAX_PLY)
{
- Value rbeta = beta + 200;
+ Value rbeta = std::min(beta + 200, VALUE_INFINITE);
Depth rdepth = depth - ONE_PLY - 3 * ONE_PLY;
assert(rdepth >= ONE_PLY);