types: 移除 Score 类型
This commit is contained in:
parent
af062f0ebd
commit
e67f6ca8a1
|
@ -35,12 +35,6 @@ double to_cp(Value v)
|
||||||
return double(v) / StoneValue;
|
return double(v) / StoneValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream &operator<<(std::ostream &os, Score s)
|
|
||||||
{
|
|
||||||
os << std::setw(5) << "" << " "
|
|
||||||
<< std::setw(5) << "";
|
|
||||||
return os;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using namespace Trace;
|
using namespace Trace;
|
||||||
|
|
|
@ -347,21 +347,6 @@ void Thread::search()
|
||||||
multiPV = std::min(multiPV, rootMoves.size());
|
multiPV = std::min(multiPV, rootMoves.size());
|
||||||
//ttHitAverage = TtHitAverageWindow * TtHitAverageResolution / 2;
|
//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;
|
int searchAgainCounter = 0;
|
||||||
|
|
||||||
// Iterative deepening loop until requested to stop or the target depth is reached
|
// Iterative deepening loop until requested to stop or the target depth is reached
|
||||||
|
@ -401,12 +386,6 @@ void Thread::search()
|
||||||
delta = Value(21);
|
delta = Value(21);
|
||||||
alpha = std::max(prev - delta, -VALUE_INFINITE);
|
alpha = std::max(prev - delta, -VALUE_INFINITE);
|
||||||
beta = std::min(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
|
// Start with a small aspiration window and, in the case of a fail
|
||||||
|
|
|
@ -71,7 +71,6 @@ public:
|
||||||
LowPlyHistory lowPlyHistory;
|
LowPlyHistory lowPlyHistory;
|
||||||
CapturePieceToHistory captureHistory;
|
CapturePieceToHistory captureHistory;
|
||||||
ContinuationHistory continuationHistory[2][2];
|
ContinuationHistory continuationHistory[2][2];
|
||||||
Score contempt;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,6 @@ constexpr bool Is64Bit = true;
|
||||||
constexpr bool Is64Bit = false;
|
constexpr bool Is64Bit = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using Score = uint32_t;
|
|
||||||
//using Bitboard = uint32_t;
|
//using Bitboard = uint32_t;
|
||||||
typedef uint32_t Bitboard;
|
typedef uint32_t Bitboard;
|
||||||
|
|
||||||
|
@ -353,11 +352,6 @@ enum Score : int
|
||||||
};
|
};
|
||||||
#endif
|
#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) \
|
#define ENABLE_BASE_OPERATORS_ON(T) \
|
||||||
constexpr T operator+(T d1, T d2) { return T(int(d1) + int(d2)); } \
|
constexpr T operator+(T d1, T d2) { return T(int(d1) + int(d2)); } \
|
||||||
|
|
Loading…
Reference in New Issue