@@ -31,20 +31,6 @@ Eval::~Eval() {
3131 evalHash = nullptr ;
3232}
3333
34- template <int side>
35- void Eval::openFile () {
36- structureEval.openFile = 0 ;
37- structureEval.semiOpenFile [side] = 0 ;
38-
39- for (u64 side_rooks = chessboard[ROOK_BLACK + side]; side_rooks; RESET_LSB (side_rooks)) {
40- const int o = BITScanForward (side_rooks);
41- if (!(FILE_[o] & (chessboard[WHITE] | chessboard[BLACK])))
42- structureEval.openFile |= FILE_[o];
43- else if (FILE_[o] & chessboard[side ^ 1 ])
44- structureEval.semiOpenFile [side] |= FILE_[o];
45- }
46- }
47-
4834/* *
4935 * evaluate pawns for color at phase
5036 * 1. if no pawns returns -NO_PAWNS
@@ -313,7 +299,7 @@ int Eval::evaluateQueen(const u64 enemies) {
313299*/
314300
315301template <int side, Eval::_Tphase phase>
316- int Eval::evaluateKnight (const u64 enemiesPawns, const u64 notMyBits) {
302+ int Eval::evaluateKnight (const u64 notMyBits) {
317303 INC (evaluationCount[side]);
318304 u64 knight = chessboard[KNIGHT_BLACK + side];
319305 if (!knight) return 0 ;
@@ -469,21 +455,12 @@ int Eval::evaluateKing(int side, u64 squares) {
469455 ADD (SCORE_DEBUG.DISTANCE_KING [side], DISTANCE_KING_OPENING[pos_king]);
470456 result = DISTANCE_KING_OPENING[pos_king];
471457 }
472- u64 POW2_king = POW2[pos_king];
458+
473459 // mobility
474460 ASSERT (bitCount (squares & NEAR_MASK1[pos_king]) < (int ) (sizeof (MOB_KING[phase]) / sizeof (int )))
475461 result += MOB_KING[phase][bitCount (squares & NEAR_MASK1[pos_king])];
476462 ADD (SCORE_DEBUG.MOB_KING [side], MOB_KING[phase][bitCount (squares & NEAR_MASK1[pos_king])]);
477- if (phase != OPEN) {
478- if ((structureEval.openFile & POW2_king) || (structureEval.semiOpenFile [side ^ 1 ] & POW2_king)) {
479- ADD (SCORE_DEBUG.END_OPENING_KING [side], -END_OPENING);
480- result -= END_OPENING;
481- if (bitCount (RANK[pos_king]) < 4 ) {
482- ADD (SCORE_DEBUG.END_OPENING_KING [side], -END_OPENING);
483- result -= END_OPENING;
484- }
485- }
486- }
463+
487464 ASSERT (pos_king < 64 )
488465 if (!(NEAR_MASK1[pos_king] & chessboard[side])) {
489466 ADD (SCORE_DEBUG.PAWN_NEAR_KING [side], -PAWN_NEAR_KING);
@@ -547,9 +524,6 @@ short Eval::getScore(const u64 key, const int side, const int alpha, const int b
547524 structureEval.posKingBit [WHITE] = POW2[structureEval.posKing [WHITE]];
548525 structureEval.kingAttackers [WHITE] = structureEval.kingAttackers [BLACK] = 0 ;
549526
550- openFile<WHITE>();
551- openFile<BLACK>();
552-
553527 _Tresult Tresult;
554528 switch (phase) {
555529 case OPEN :
@@ -596,12 +570,6 @@ short Eval::getScore(const u64 key, const int side, const int alpha, const int b
596570 } else {
597571 cout << " END\n " ;
598572 }
599- cout << " |OPEN FILE: " ;
600- if (!structureEval.openFile )cout << " none" ;
601- else
602- for (int i = 0 ; i < 8 ; i++) if (POW2[i] & structureEval.openFile )cout << (char ) (65 + i) << " " ;
603- cout << " \n " ;
604-
605573
606574 cout << " |VALUES:" ;
607575 cout << " \t PAWN: " << (double ) constants::VALUEPAWN / 100.0 ;
@@ -737,9 +705,7 @@ short Eval::getScore(const u64 key, const int side, const int alpha, const int b
737705 cout << " | distance: " << setw (10 ) <<
738706 (double ) (SCORE_DEBUG.DISTANCE_KING [WHITE]) / 100.0 << setw (10 ) <<
739707 (double ) (SCORE_DEBUG.DISTANCE_KING [BLACK]) / 100.0 << " \n " ;
740- cout << " | open file: " << setw (10 ) <<
741- (double ) (SCORE_DEBUG.END_OPENING_KING [WHITE]) / 100.0 << setw (10 ) <<
742- (double ) (SCORE_DEBUG.END_OPENING_KING [BLACK]) / 100.0 << " \n " ;
708+
743709 cout << " | pawn near: " << setw (10 ) <<
744710 (double ) (SCORE_DEBUG.PAWN_NEAR_KING [WHITE]) / 100.0 << setw (10 ) <<
745711 (double ) (SCORE_DEBUG.PAWN_NEAR_KING [BLACK]) / 100.0 << " \n " ;
0 commit comments