- if(value <= alpha && i >= MultiPV)
- rml.set_move_score(i, -VALUE_INFINITE);
- else {
- // New best move!
-
- // Update PV:
- rml.set_move_score(i, value);
- update_pv(ss, 0);
- rml.set_move_pv(i, ss[0].pv);
-
- if(MultiPV == 1) {
- // We record how often the best move has been changed in each
- // iteration. This information is used for time managment: When
- // the best move changes frequently, we allocate some more time.
- if(i > 0)
- BestMoveChangesByIteration[Iteration]++;
-
- // Print search information to the standard output:
- std::cout << "info depth " << Iteration
- << " score " << value_to_string(value)
- << " time " << current_search_time()
- << " nodes " << nodes_searched()
- << " nps " << nps()
- << " pv ";
- for(int j = 0; ss[0].pv[j] != MOVE_NONE && j < PLY_MAX; j++)
- std::cout << ss[0].pv[j] << " ";
- std::cout << std::endl;
-
- if(UseLogFile)
- LogFile << pretty_pv(pos, current_search_time(), Iteration,
- nodes_searched(), value, ss[0].pv)
- << std::endl;
-
- alpha = value;
-
- // Reset the global variable Problem to false if the value isn't too
- // far below the final value from the last iteration.
- if(value > ValueByIteration[Iteration - 1] - NoProblemMargin)
- Problem = false;
- }
- else { // MultiPV > 1
- rml.sort_multipv(i);
- for(int j = 0; j < Min(MultiPV, rml.move_count()); j++) {
- int k;
- std::cout << "info multipv " << j + 1
- << " score " << value_to_string(rml.get_move_score(j))
- << " depth " << ((j <= i)? Iteration : Iteration - 1)
- << " time " << current_search_time()
- << " nodes " << nodes_searched()
- << " nps " << nps()
- << " pv ";
- for(k = 0; rml.get_move_pv(j, k) != MOVE_NONE && k < PLY_MAX; k++)
- std::cout << rml.get_move_pv(j, k) << " ";
- std::cout << std::endl;
- }
- alpha = rml.get_move_score(Min(i, MultiPV-1));
+ if (value <= alpha && i >= MultiPV)
+ rml.set_move_score(i, -VALUE_INFINITE);
+ else
+ {
+ // New best move!
+
+ // Update PV
+ rml.set_move_score(i, value);
+ update_pv(ss, 0);
+ rml.set_move_pv(i, ss[0].pv);
+
+ if (MultiPV == 1)
+ {
+ // We record how often the best move has been changed in each
+ // iteration. This information is used for time managment: When
+ // the best move changes frequently, we allocate some more time.
+ if (i > 0)
+ BestMoveChangesByIteration[Iteration]++;
+
+ // Print search information to the standard output:
+ std::cout << "info depth " << Iteration
+ << " score " << value_to_string(value)
+ << " time " << current_search_time()
+ << " nodes " << nodes_searched()
+ << " nps " << nps()
+ << " pv ";
+
+ for (int j = 0; ss[0].pv[j] != MOVE_NONE && j < PLY_MAX; j++)
+ std::cout << ss[0].pv[j] << " ";
+
+ std::cout << std::endl;
+
+ if (UseLogFile)
+ LogFile << pretty_pv(pos, current_search_time(), Iteration, nodes_searched(), value, ss[0].pv)
+ << std::endl;
+
+ alpha = value;
+
+ // Reset the global variable Problem to false if the value isn't too
+ // far below the final value from the last iteration.
+ if (value > ValueByIteration[Iteration - 1] - NoProblemMargin)
+ Problem = false;
+ }
+ else // MultiPV > 1
+ {
+ rml.sort_multipv(i);
+ for (int j = 0; j < Min(MultiPV, rml.move_count()); j++)
+ {
+ int k;
+ std::cout << "info multipv " << j + 1
+ << " score " << value_to_string(rml.get_move_score(j))
+ << " depth " << ((j <= i)? Iteration : Iteration - 1)
+ << " time " << current_search_time()
+ << " nodes " << nodes_searched()
+ << " nps " << nps()
+ << " pv ";
+
+ for (k = 0; rml.get_move_pv(j, k) != MOVE_NONE && k < PLY_MAX; k++)
+ std::cout << rml.get_move_pv(j, k) << " ";
+
+ std::cout << std::endl;
+ }
+ alpha = rml.get_move_score(Min(i, MultiPV-1));
+ }