mirror of
https://github.com/sockspls/badfish
synced 2025-05-03 18:19:35 +00:00
Add initiative to trace
No functional change
This commit is contained in:
parent
9d79138682
commit
0dc3b0978d
1 changed files with 6 additions and 2 deletions
|
@ -45,7 +45,7 @@ namespace {
|
||||||
enum Tracing {NO_TRACE, TRACE};
|
enum Tracing {NO_TRACE, TRACE};
|
||||||
|
|
||||||
enum Term { // The first 8 entries are for PieceType
|
enum Term { // The first 8 entries are for PieceType
|
||||||
MATERIAL = 8, IMBALANCE, MOBILITY, THREAT, PASSED, SPACE, TOTAL, TERM_NB
|
MATERIAL = 8, IMBALANCE, MOBILITY, THREAT, PASSED, SPACE, INITIATIVE, TOTAL, TERM_NB
|
||||||
};
|
};
|
||||||
|
|
||||||
double scores[TERM_NB][COLOR_NB][PHASE_NB];
|
double scores[TERM_NB][COLOR_NB][PHASE_NB];
|
||||||
|
@ -63,7 +63,7 @@ namespace {
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& os, Term t) {
|
std::ostream& operator<<(std::ostream& os, Term t) {
|
||||||
|
|
||||||
if (t == MATERIAL || t == IMBALANCE || t == Term(PAWN) || t == TOTAL)
|
if (t == MATERIAL || t == IMBALANCE || t == Term(PAWN) || t == INITIATIVE || t == TOTAL)
|
||||||
os << " --- --- | --- --- | ";
|
os << " --- --- | --- --- | ";
|
||||||
else
|
else
|
||||||
os << std::setw(5) << scores[t][WHITE][MG] << " "
|
os << std::setw(5) << scores[t][WHITE][MG] << " "
|
||||||
|
@ -775,6 +775,9 @@ namespace {
|
||||||
// that the endgame score will never change sign after the bonus.
|
// that the endgame score will never change sign after the bonus.
|
||||||
int v = ((eg > 0) - (eg < 0)) * std::max(initiative, -abs(eg));
|
int v = ((eg > 0) - (eg < 0)) * std::max(initiative, -abs(eg));
|
||||||
|
|
||||||
|
if (T)
|
||||||
|
Trace::add(INITIATIVE, make_score(0, v));
|
||||||
|
|
||||||
return make_score(0, v);
|
return make_score(0, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -935,6 +938,7 @@ std::string Eval::trace(const Position& pos) {
|
||||||
<< " Threats | " << Term(THREAT)
|
<< " Threats | " << Term(THREAT)
|
||||||
<< " Passed pawns | " << Term(PASSED)
|
<< " Passed pawns | " << Term(PASSED)
|
||||||
<< " Space | " << Term(SPACE)
|
<< " Space | " << Term(SPACE)
|
||||||
|
<< " Initiative | " << Term(INITIATIVE)
|
||||||
<< "----------------+-------------+-------------+-------------\n"
|
<< "----------------+-------------+-------------+-------------\n"
|
||||||
<< " Total | " << Term(TOTAL);
|
<< " Total | " << Term(TOTAL);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue