]> git.sesse.net Git - stockfish/blobdiff - src/movepick.cpp
Use more continuation histories.
[stockfish] / src / movepick.cpp
index 9d5805a70a463708e873a44794bae3d19c7a12cb..bc3fcf7ed6b8f53a955c582275d91d9a309e96c6 100644 (file)
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include "movepick.h"
+
+#include <algorithm>
 #include <cassert>
+#include <iterator>
+#include <utility>
 
 #include "bitboard.h"
-#include "movepick.h"
+#include "position.h"
 
 namespace Stockfish {
 
@@ -50,11 +55,11 @@ namespace {
 } // namespace
 
 
-/// Constructors of the MovePicker class. As arguments we pass information
-/// to help it to return the (presumably) good moves first, to decide which
+/// Constructors of the MovePicker class. As arguments, we pass information
+/// to help it return the (presumably) good moves first, to decide which
 /// moves to return (in the quiescence search, for instance, we only want to
-/// search captures, promotions, and some checks) and how important good move
-/// ordering is at the current node.
+/// search captures, promotions, and some checks) and how important a good
+/// move ordering is at the current node.
 
 /// MovePicker constructor for the main search
 MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const ButterflyHistory* mh,
@@ -136,6 +141,7 @@ void MovePicker::score() {
           m.value =  2 * (*mainHistory)[pos.side_to_move()][from_to(m)];
           m.value += 2 * (*continuationHistory[0])[pc][to];
           m.value +=     (*continuationHistory[1])[pc][to];
+          m.value +=     (*continuationHistory[2])[pc][to] / 4;
           m.value +=     (*continuationHistory[3])[pc][to];
           m.value +=     (*continuationHistory[5])[pc][to];
 
@@ -161,7 +167,7 @@ void MovePicker::score() {
                        :                                                0 )
                        :                                                0 ;
       }
-      
+
       else // Type == EVASIONS
       {
           if (pos.capture_stage(m))