No functional change.
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.
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);
// 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)
namespace Eval {
-extern Color RootColor;
-
extern void init();
extern Value evaluate(const Position& pos, Value& margin);
extern std::string trace(const Position& pos);
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
LimitsType Limits;
std::vector<RootMove> RootMoves;
Position RootPosition;
+ Color RootColor;
Time::point SearchTime;
StateStackPtr SetupStates;
}
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();
{
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;
extern LimitsType Limits;
extern std::vector<RootMove> RootMoves;
extern Position RootPosition;
+extern Color RootColor;
extern Time::point SearchTime;
extern StateStackPtr SetupStates;
QUEEN_SIDE
};
+enum Phase {
+ PHASE_ENDGAME = 0,
+ PHASE_MIDGAME = 128
+};
+
enum ScaleFactor {
SCALE_FACTOR_DRAW = 0,
SCALE_FACTOR_NORMAL = 64,