parent
55bd27b8f0
commit
6b909b2343
|
@ -267,8 +267,6 @@ namespace {
|
|||
|
||||
namespace Eval {
|
||||
|
||||
Color RootColor;
|
||||
|
||||
/// evaluate() is the main evaluation function. It always computes two
|
||||
/// values, an endgame score and a middle game score, and interpolates
|
||||
/// between them based on the remaining material.
|
||||
|
@ -319,7 +317,7 @@ namespace Eval {
|
|||
Value margin;
|
||||
std::string totals;
|
||||
|
||||
RootColor = pos.side_to_move();
|
||||
Search::RootColor = pos.side_to_move();
|
||||
|
||||
TraceStream.str("");
|
||||
TraceStream << std::showpoint << std::showpos << std::fixed << std::setprecision(2);
|
||||
|
@ -853,8 +851,8 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
|||
// value that will be used for pruning because this value can sometimes
|
||||
// be very big, and so capturing a single attacking piece can therefore
|
||||
// result in a score change far bigger than the value of the captured piece.
|
||||
score -= KingDangerTable[Us == Eval::RootColor][attackUnits];
|
||||
margins[Us] += mg_value(KingDangerTable[Us == Eval::RootColor][attackUnits]);
|
||||
score -= KingDangerTable[Us == Search::RootColor][attackUnits];
|
||||
margins[Us] += mg_value(KingDangerTable[Us == Search::RootColor][attackUnits]);
|
||||
}
|
||||
|
||||
if (Trace)
|
||||
|
|
|
@ -26,8 +26,6 @@ class Position;
|
|||
|
||||
namespace Eval {
|
||||
|
||||
extern Color RootColor;
|
||||
|
||||
extern void init();
|
||||
extern Value evaluate(const Position& pos, Value& margin);
|
||||
extern std::string trace(const Position& pos);
|
||||
|
|
|
@ -27,13 +27,6 @@
|
|||
|
||||
const int MaterialTableSize = 8192;
|
||||
|
||||
/// Game phase
|
||||
enum Phase {
|
||||
PHASE_ENDGAME = 0,
|
||||
PHASE_MIDGAME = 128
|
||||
};
|
||||
|
||||
|
||||
/// MaterialEntry is a class which contains various information about a
|
||||
/// material configuration. It contains a material balance evaluation,
|
||||
/// a function pointer to a special endgame evaluation function (which in
|
||||
|
|
|
@ -42,6 +42,7 @@ namespace Search {
|
|||
LimitsType Limits;
|
||||
std::vector<RootMove> RootMoves;
|
||||
Position RootPosition;
|
||||
Color RootColor;
|
||||
Time::point SearchTime;
|
||||
StateStackPtr SetupStates;
|
||||
}
|
||||
|
@ -174,7 +175,7 @@ void Search::think() {
|
|||
|
||||
Position& pos = RootPosition;
|
||||
Chess960 = pos.is_chess960();
|
||||
Eval::RootColor = pos.side_to_move();
|
||||
RootColor = pos.side_to_move();
|
||||
TimeMgr.init(Limits, pos.startpos_ply_counter(), pos.side_to_move());
|
||||
TT.new_search();
|
||||
H.clear();
|
||||
|
@ -192,8 +193,8 @@ void Search::think() {
|
|||
{
|
||||
int cf = Options["Contempt Factor"] * PawnValueMg / 100; // In centipawns
|
||||
cf = cf * MaterialTable::game_phase(pos) / PHASE_MIDGAME; // Scale down with phase
|
||||
DrawValue[ Eval::RootColor] = VALUE_DRAW - Value(cf);
|
||||
DrawValue[~Eval::RootColor] = VALUE_DRAW + Value(cf);
|
||||
DrawValue[ RootColor] = VALUE_DRAW - Value(cf);
|
||||
DrawValue[~RootColor] = VALUE_DRAW + Value(cf);
|
||||
}
|
||||
else
|
||||
DrawValue[WHITE] = DrawValue[BLACK] = VALUE_DRAW;
|
||||
|
|
|
@ -99,6 +99,7 @@ extern volatile SignalsType Signals;
|
|||
extern LimitsType Limits;
|
||||
extern std::vector<RootMove> RootMoves;
|
||||
extern Position RootPosition;
|
||||
extern Color RootColor;
|
||||
extern Time::point SearchTime;
|
||||
extern StateStackPtr SetupStates;
|
||||
|
||||
|
|
|
@ -144,6 +144,11 @@ enum CastlingSide {
|
|||
QUEEN_SIDE
|
||||
};
|
||||
|
||||
enum Phase {
|
||||
PHASE_ENDGAME = 0,
|
||||
PHASE_MIDGAME = 128
|
||||
};
|
||||
|
||||
enum ScaleFactor {
|
||||
SCALE_FACTOR_DRAW = 0,
|
||||
SCALE_FACTOR_NORMAL = 64,
|
||||
|
|
Loading…
Reference in New Issue