1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

Complete the renaming in Search::LimitsType

This completes the job started with revision
4124c94583.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2012-03-31 09:16:09 +01:00
parent cc6c745b54
commit d84865eac3
4 changed files with 10 additions and 10 deletions

View file

@ -290,8 +290,8 @@ void Search::think() {
log << "\nSearching: " << pos.to_fen() log << "\nSearching: " << pos.to_fen()
<< "\ninfinite: " << Limits.infinite << "\ninfinite: " << Limits.infinite
<< " ponder: " << Limits.ponder << " ponder: " << Limits.ponder
<< " time: " << Limits.times[pos.side_to_move()] << " time: " << Limits.time[pos.side_to_move()]
<< " increment: " << Limits.incs[pos.side_to_move()] << " increment: " << Limits.inc[pos.side_to_move()]
<< " moves to go: " << Limits.movestogo << " moves to go: " << Limits.movestogo
<< endl; << endl;
} }

View file

@ -80,7 +80,7 @@ struct LimitsType {
LimitsType() { memset(this, 0, sizeof(LimitsType)); } LimitsType() { memset(this, 0, sizeof(LimitsType)); }
bool use_time_management() const { return !(movetime | depth | nodes | infinite); } bool use_time_management() const { return !(movetime | depth | nodes | infinite); }
int times[2], incs[2], movestogo, depth, nodes, movetime, infinite, ponder; int time[2], inc[2], movestogo, depth, nodes, movetime, infinite, ponder;
}; };

View file

@ -111,15 +111,15 @@ void TimeManager::init(const Search::LimitsType& limits, int currentPly, Color u
// Initialize to maximum values but unstablePVExtraTime that is reset // Initialize to maximum values but unstablePVExtraTime that is reset
unstablePVExtraTime = 0; unstablePVExtraTime = 0;
optimumSearchTime = maximumSearchTime = limits.times[us]; optimumSearchTime = maximumSearchTime = limits.time[us];
// We calculate optimum time usage for different hypothetic "moves to go"-values and choose the // 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. // 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 // Calculate thinking time for hypothetic "moves to go"-value
hypMyTime = limits.times[us] hypMyTime = limits.time[us]
+ limits.incs[us] * (hypMTG - 1) + limits.inc[us] * (hypMTG - 1)
- emergencyBaseTime - emergencyBaseTime
- emergencyMoveTime * std::min(hypMTG, emergencyMoveHorizon); - emergencyMoveTime * std::min(hypMTG, emergencyMoveHorizon);

View file

@ -204,13 +204,13 @@ namespace {
while (is >> token) while (is >> token)
{ {
if (token == "wtime") if (token == "wtime")
is >> limits.times[WHITE]; is >> limits.time[WHITE];
else if (token == "btime") else if (token == "btime")
is >> limits.times[BLACK]; is >> limits.time[BLACK];
else if (token == "winc") else if (token == "winc")
is >> limits.incs[WHITE]; is >> limits.inc[WHITE];
else if (token == "binc") else if (token == "binc")
is >> limits.incs[BLACK]; is >> limits.inc[BLACK];
else if (token == "movestogo") else if (token == "movestogo")
is >> limits.movestogo; is >> limits.movestogo;
else if (token == "depth") else if (token == "depth")