RootMoveList Rml;
// MultiPV mode
- int MultiPV, UCIMultiPV, MultiPVIdx;
+ size_t MultiPV, UCIMultiPV, MultiPVIdx;
// Time management variables
TimeManager TimeMgr;
TT.clear();
}
- UCIMultiPV = Options["MultiPV"].value<int>();
- SkillLevel = Options["Skill Level"].value<int>();
+ UCIMultiPV = Options["MultiPV"].value<size_t>();
+ SkillLevel = Options["Skill Level"].value<size_t>();
// Do we have to play with skill handicap? In this case enable MultiPV that
// we will use behind the scenes to retrieve a set of possible moves.
SkillLevelEnabled = (SkillLevel < 20);
- MultiPV = (SkillLevelEnabled ? std::max(UCIMultiPV, 4) : UCIMultiPV);
+ MultiPV = (SkillLevelEnabled ? std::max(UCIMultiPV, 4U) : UCIMultiPV);
// Write current search header to log file
if (Options["Use Search Log"].value<bool>())
Rml.bestMoveChanges = 0;
// MultiPV loop. We perform a full root search for each PV line
- for (MultiPVIdx = 0; MultiPVIdx < std::min(MultiPV, (int)Rml.size()); MultiPVIdx++)
+ for (MultiPVIdx = 0; MultiPVIdx < std::min(MultiPV, Rml.size()); MultiPVIdx++)
{
// Calculate dynamic aspiration window based on previous iterations
if (depth >= 5 && abs(Rml[MultiPVIdx].prevScore) < VALUE_KNOWN_WIN)
// Write PV back to transposition table in case the relevant entries
// have been overwritten during the search.
- for (int i = 0; i <= MultiPVIdx; i++)
+ for (size_t i = 0; i <= MultiPVIdx; i++)
Rml[i].insert_pv_in_tt(pos);
// If search has been stopped exit the aspiration window loop,
// protocol requires to send all the PV lines also if are still
// to be searched and so refer to the previous search's score.
if ((bestValue > alpha && bestValue < beta) || elapsed_time() > 2000)
- for (int i = 0; i < std::min(UCIMultiPV, (int)Rml.size()); i++)
+ for (size_t i = 0; i < std::min(UCIMultiPV, Rml.size()); i++)
{
bool updated = (i <= MultiPVIdx);
// Rml list is already sorted by score in descending order
int s;
+ size_t size = std::min(MultiPV, Rml.size());
int max_s = -VALUE_INFINITE;
- int size = std::min(MultiPV, (int)Rml.size());
int max = Rml[0].score;
int var = std::min(max - Rml[size - 1].score, int(PawnValueMidgame));
int wk = 120 - 2 * SkillLevel;
// Choose best move. For each move's score we add two terms both dependent
// on wk, one deterministic and bigger for weaker moves, and one random,
// then we choose the move with the resulting highest score.
- for (int i = 0; i < size; i++)
+ for (size_t i = 0; i < size; i++)
{
s = Rml[i].score;