11#include " eval.h"
22
3- <<<<<<< HEAD
43// Define enum class for evaluation keys
54enum class EvalKey {
65 DOUBLED, BACKWARD, BLOCKED, ISLANDED, ISOLATED, DBLISOLATED, WEAK, PAWNRACE,
@@ -1008,15 +1007,6 @@ int psqt_eval(const chess::Position& board) {
10081007}
10091008
10101009int eval (chess::Position board) {
1011- =======
1012- std::unordered_map<U64, int > transposition; // Faster lookup
1013-
1014- // Declare only missing functions
1015- int evaluatePawnStructure (const chess::Board& board);
1016- int evaluatePieces (const chess::Board& board);
1017-
1018- int eval (chess::Board &board) {
1019- >>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
10201010 U64 hash = board.hash ();
10211011 // Faster lookup & insertion
10221012 auto [it, inserted] = transposition.emplace (hash, 0 );
@@ -1040,42 +1030,30 @@ int eval(chess::Board &board) {
10401030 };
10411031
10421032 // Compute material score
1043- <<<<<<< HEAD
10441033 int eval = (EvalWeights::getWeight (EvalKey::PAWN) * (pieceCount[0 ] - pieceCount[5 ])) +
10451034 (EvalWeights::getWeight (EvalKey::KNIGHT) * (pieceCount[1 ] - pieceCount[6 ])) +
10461035 (EvalWeights::getWeight (EvalKey::BISHOP) * (pieceCount[2 ] - pieceCount[7 ])) +
10471036 (EvalWeights::getWeight (EvalKey::ROOK) * (pieceCount[3 ] - pieceCount[8 ])) +
10481037 (EvalWeights::getWeight (EvalKey::QUEEN) * (pieceCount[4 ] - pieceCount[9 ]));
1049- =======
1050- int eval = (Pawn * (pieceCount[0 ] - pieceCount[5 ])) +
1051- (Knight * (pieceCount[1 ] - pieceCount[6 ])) +
1052- (Bishop * (pieceCount[2 ] - pieceCount[7 ])) +
1053- (Rook * (pieceCount[3 ] - pieceCount[8 ])) +
1054- (Queen * (pieceCount[4 ] - pieceCount[9 ]));
1055- >>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
10561038
10571039 // Evaluate positional aspects
10581040 eval += evaluatePawnStructure (board);
10591041 eval += evaluatePieces (board);
10601042 eval += evaluateKingSafety (board);
10611043 eval += evaluateTactics (board);
1062- <<<<<<< HEAD
10631044 eval += piece_activity (board);
10641045 eval += development (board);
10651046 eval += rook_placement (board);
10661047 eval += center_control (board);
10671048 eval += key_center_squares_control (board);
10681049 eval += psqt_eval (board);
10691050 eval += evaluatePieceActivity (board);
1070- =======
1071- >>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
10721051 board.makeNullMove ();
10731052 // Evaluate positional aspects
10741053 eval -= evaluatePawnStructure (board);
10751054 eval -= evaluatePieces (board);
10761055 eval -= evaluateKingSafety (board);
10771056 eval -= evaluateTactics (board);
1078- <<<<<<< HEAD
10791057 eval -= piece_activity (board);
10801058 eval -= development (board);
10811059 eval -= rook_placement (board);
@@ -1085,40 +1063,25 @@ int eval(chess::Board &board) {
10851063 eval -= evaluatePieceActivity (board);
10861064 board.unmakeNullMove ();
10871065
1088- =======
1089- board.unmakeNullMove ();
1090- >>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
10911066 it->second = eval; // Store result
10921067 return eval;
10931068}
10941069
1095- <<<<<<< HEAD
10961070// Use `const chess::Position&` to avoid copies
10971071int evaluatePawnStructure (const chess::Position& board) {
10981072 chess::Position b=board;
1099- =======
1100- // Use `const chess::Board&` to avoid copies
1101- int evaluatePawnStructure (const chess::Board& board) {
1102- chess::Board b=board;
1103- >>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
11041073 return -(isolated (board) + dblisolated (board) + weaks (board) + blockage (board) +
11051074 holes (board) + underpromote (b) + weakness (board) + evaluatePawnRams (board)) +
11061075 (pawnIslands (board) + pawnRace (board) + pawnShield (board) + pawnStorm (board) +
11071076 pawnLevers (board) + outpost (board) + evaluateUnfreePawns (board) + evaluateOpenPawns (board));
11081077}
11091078
1110- <<<<<<< HEAD
11111079// Use `const chess::Position&` to avoid copies
11121080int evaluatePieces (const chess::Position& board) {
1113- =======
1114- // Use `const chess::Board&` to avoid copies
1115- int evaluatePieces (const chess::Board& board) {
1116- >>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
11171081 return -(evaluateBadBishops (board) + evaluateTrappedPieces (board) + evaluateKnightForks (board)) +
11181082 (evaluateFianchetto (board) + evaluateRooksOnFiles (board));
11191083}
11201084
1121- <<<<<<< HEAD
11221085int piece_value (chess::PieceType piece) {
11231086 switch (piece) {
11241087 case (int )chess::PieceType::PAWN: return EvalWeights::getWeight (EvalKey::PAWN);
@@ -1129,5 +1092,3 @@ int piece_value(chess::PieceType piece) {
11291092 default : return 0 ; // King has no standard value
11301093 }
11311094}
1132- =======
1133- >>>>>>> 08822de3005f1e1458cbbb02037d1f714fcd46e7
0 commit comments