Add psqt ordering when there is no history

This seems to increase strenght (about 15 ELO),
still to test some variations on this theme that
could increase ELO even more.

Idea from Rebel (http://members.home.nl/matador/chess840.htm)

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2008-10-15 07:18:05 +01:00
parent cb76e4a814
commit 644db060ae
2 changed files with 35 additions and 8 deletions

View File

@@ -246,15 +246,36 @@ void MovePicker::score_captures() {
}
void MovePicker::score_noncaptures() {
for(int i = 0; i < numOfMoves; i++) {
Move m = moves[i].move;
if(m == killer1)
moves[i].score = HistoryMax + 2;
else if(m == killer2)
moves[i].score = HistoryMax + 1;
else
moves[i].score = H.move_ordering_score(pos->piece_on(move_from(m)), m);
bool all_zero = true;
for (int i = 0; i < numOfMoves; i++)
{
Move m = moves[i].move;
if (m == killer1)
{
moves[i].score = HistoryMax + 2;
all_zero = false;
}
else if (m == killer2)
{
moves[i].score = HistoryMax + 1;
all_zero = false;
}
else
{
moves[i].score = H.move_ordering_score(pos->piece_on(move_from(m)), m);
if (all_zero && moves[i].score != 0)
all_zero = false;
}
}
if (!all_zero)
return;
// If we don't have at least one history score then
// try to order using psq tables difference between
// from square and to square.
for (int i = 0; i < numOfMoves; i++)
moves[i].score = pos->mg_pst_delta(moves[i].move);
}
void MovePicker::score_evasions() {