Rename FromTo -> History (#963)

Previously, we had duplicated History:

- one with (piece,to) called History
- one with (from,to) called FromTo

Now that we have only one, rename it to History, which is the generally accepted
name in the chess programming litterature for this technique.

Also correct some comments that had not been updated since the introduction of CMH.

No functional change.
This commit is contained in:
lucasart
2017-01-10 15:47:56 +08:00
committed by Marco Costalba
parent e0504ab876
commit 34e47ca87d
4 changed files with 41 additions and 39 deletions

View File

@@ -140,7 +140,7 @@ void MovePicker::score<CAPTURES>() {
template<>
void MovePicker::score<QUIETS>() {
const FromToStats& fromTo = pos.this_thread()->fromTo;
const HistoryStats& history = pos.this_thread()->history;
const CounterMoveStats* cmh = (ss-1)->counterMoves;
const CounterMoveStats* fmh = (ss-2)->counterMoves;
@@ -152,21 +152,21 @@ void MovePicker::score<QUIETS>() {
m.value = (cmh ? (*cmh)[pos.moved_piece(m)][to_sq(m)] : VALUE_ZERO)
+ (fmh ? (*fmh)[pos.moved_piece(m)][to_sq(m)] : VALUE_ZERO)
+ (fmh2 ? (*fmh2)[pos.moved_piece(m)][to_sq(m)] : VALUE_ZERO)
+ fromTo.get(c, m);
+ history.get(c, m);
}
template<>
void MovePicker::score<EVASIONS>() {
// Try captures ordered by MVV/LVA, then non-captures ordered by stats heuristics
const FromToStats& fromTo = pos.this_thread()->fromTo;
const HistoryStats& history = pos.this_thread()->history;
Color c = pos.side_to_move();
for (auto& m : *this)
if (pos.capture(m))
m.value = PieceValue[MG][pos.piece_on(to_sq(m))]
- Value(type_of(pos.moved_piece(m))) + FromToStats::Max;
- Value(type_of(pos.moved_piece(m))) + HistoryStats::Max;
else
m.value = fromTo.get(c, m);
m.value = history.get(c, m);
}