1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Rename time variable to reflect UCI parameters

On top of previous patch, rename time variables to
reflect the simplification of UCI parameters.

It is more correct to use as varibales directly the
corresponding UCI option, without intorducing redundant
intermediate variables.

This allows also to simplify the code.

No functional change.
This commit is contained in:
Marco Costalba 2014-09-18 15:44:38 +02:00 committed by lucasart
parent 2eec710318
commit 4d0a6c5a6f

View file

@ -89,9 +89,7 @@ void TimeManager::init(const Search::LimitsType& limits, int currentPly, Color u
int hypMTG, hypMyTime, t1, t2; int hypMTG, hypMyTime, t1, t2;
// Read uci parameters // Read uci parameters
int emergencyMoveHorizon = 40; int moveOverhead = Options["Move Overhead"];
int emergencyBaseTime = Options["Move Overhead"] * 2;
int emergencyMoveTime = Options["Move Overhead"];
int minThinkingTime = Options["Minimum Thinking Time"]; int minThinkingTime = Options["Minimum Thinking Time"];
int slowMover = Options["Slow Mover"]; int slowMover = Options["Slow Mover"];
@ -106,8 +104,7 @@ void TimeManager::init(const Search::LimitsType& limits, int currentPly, Color u
// Calculate thinking time for hypothetical "moves to go"-value // Calculate thinking time for hypothetical "moves to go"-value
hypMyTime = limits.time[us] hypMyTime = limits.time[us]
+ limits.inc[us] * (hypMTG - 1) + limits.inc[us] * (hypMTG - 1)
- emergencyBaseTime - moveOverhead * (2 + std::min(hypMTG, 40));
- emergencyMoveTime * std::min(hypMTG, emergencyMoveHorizon);
hypMyTime = std::max(hypMyTime, 0); hypMyTime = std::max(hypMyTime, 0);