Use UCI names in Search::LimitsType

There is no need to "invent" different names
from the original UCI parameters.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2012-03-27 12:27:57 +02:00
parent a56322fde8
commit 4124c94583
6 changed files with 39 additions and 43 deletions

View File

@@ -83,7 +83,7 @@ void TimeManager::pv_instability(int curChanges, int prevChanges) {
}
void TimeManager::init(const Search::LimitsType& limits, int currentPly)
void TimeManager::init(const Search::LimitsType& limits, int currentPly, Color us)
{
/* We support four different kind of time controls:
@@ -111,15 +111,15 @@ void TimeManager::init(const Search::LimitsType& limits, int currentPly)
// Initialize to maximum values but unstablePVExtraTime that is reset
unstablePVExtraTime = 0;
optimumSearchTime = maximumSearchTime = limits.time;
optimumSearchTime = maximumSearchTime = limits.times[us];
// We calculate optimum time usage for different hypothetic "moves to go"-values and choose the
// minimum of calculated search time values. Usually the greatest hypMTG gives the minimum values.
for (hypMTG = 1; hypMTG <= (limits.movesToGo ? std::min(limits.movesToGo, MoveHorizon) : MoveHorizon); hypMTG++)
for (hypMTG = 1; hypMTG <= (limits.movestogo ? std::min(limits.movestogo, MoveHorizon) : MoveHorizon); hypMTG++)
{
// Calculate thinking time for hypothetic "moves to go"-value
hypMyTime = limits.time
+ limits.increment * (hypMTG - 1)
hypMyTime = limits.times[us]
+ limits.incs[us] * (hypMTG - 1)
- emergencyBaseTime
- emergencyMoveTime * std::min(hypMTG, emergencyMoveHorizon);