types: 移除 Score 类型

This commit is contained in:
Calcitem 2020-09-24 01:20:10 +08:00
parent af062f0ebd
commit e67f6ca8a1
4 changed files with 0 additions and 34 deletions

View File

@ -35,12 +35,6 @@ double to_cp(Value v)
return double(v) / StoneValue;
}
std::ostream &operator<<(std::ostream &os, Score s)
{
os << std::setw(5) << "" << " "
<< std::setw(5) << "";
return os;
}
}
using namespace Trace;

View File

@ -347,21 +347,6 @@ void Thread::search()
multiPV = std::min(multiPV, rootMoves.size());
//ttHitAverage = TtHitAverageWindow * TtHitAverageResolution / 2;
//int ct = int(Options["Contempt"]) * PawnValueEg / 100; // From centipawns
int ct = int(Options["Contempt"]) * StoneValue / 100; // From centipawns // TODO
// In analysis mode, adjust contempt in accordance with user preference
if (Limits.infinite || Options["UCI_AnalyseMode"])
ct = Options["Analysis Contempt"] == "Off" ? 0
: Options["Analysis Contempt"] == "Both" ? ct
: Options["Analysis Contempt"] == "White" && us == BLACK ? -ct
: Options["Analysis Contempt"] == "Black" && us == WHITE ? -ct
: ct;
// Evaluation score is from the white point of view
contempt = (us == WHITE ? make_score(ct, ct / 2)
: -make_score(ct, ct / 2));
int searchAgainCounter = 0;
// Iterative deepening loop until requested to stop or the target depth is reached
@ -401,12 +386,6 @@ void Thread::search()
delta = Value(21);
alpha = std::max(prev - delta, -VALUE_INFINITE);
beta = std::min(prev + delta, VALUE_INFINITE);
// Adjust contempt based on root move's previousScore (dynamic contempt)
int dct = ct + (102 - ct / 2) * prev / (abs(prev) + 157);
contempt = (us == WHITE ? make_score(dct, dct / 2)
: -make_score(dct, dct / 2));
}
// Start with a small aspiration window and, in the case of a fail

View File

@ -71,7 +71,6 @@ public:
LowPlyHistory lowPlyHistory;
CapturePieceToHistory captureHistory;
ContinuationHistory continuationHistory[2][2];
Score contempt;
};

View File

@ -99,7 +99,6 @@ constexpr bool Is64Bit = true;
constexpr bool Is64Bit = false;
#endif
using Score = uint32_t;
//using Bitboard = uint32_t;
typedef uint32_t Bitboard;
@ -353,11 +352,6 @@ enum Score : int
};
#endif
// TODO Begin
constexpr Score make_score(int mg, int eg)
{
return Score((int)((unsigned int)eg << 16) + mg);
}
#define ENABLE_BASE_OPERATORS_ON(T) \
constexpr T operator+(T d1, T d2) { return T(int(d1) + int(d2)); } \