mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
committed by
Joona Kiiski
parent
a273b6ef8c
commit
647402ff79
@@ -467,7 +467,7 @@ namespace {
|
||||
}
|
||||
|
||||
|
||||
// evaluate_threats() assigns bonuses according to the types of the attacking
|
||||
// evaluate_threats() assigns bonuses according to the types of the attacking
|
||||
// and the attacked pieces.
|
||||
|
||||
template<Color Us, bool DoTrace>
|
||||
@@ -679,12 +679,12 @@ namespace {
|
||||
// status of the players.
|
||||
Score evaluate_initiative(const Position& pos, int asymmetry, Value eg) {
|
||||
|
||||
int kingDistance = distance<File>(pos.square<KING>(WHITE), pos.square<KING>(BLACK))
|
||||
- distance<Rank>(pos.square<KING>(WHITE), pos.square<KING>(BLACK));
|
||||
int kingDistance = distance<File>(pos.square<KING>(WHITE), pos.square<KING>(BLACK))
|
||||
- distance<Rank>(pos.square<KING>(WHITE), pos.square<KING>(BLACK));
|
||||
int pawns = pos.count<PAWN>(WHITE) + pos.count<PAWN>(BLACK);
|
||||
|
||||
// Compute the initiative bonus for the attacking side
|
||||
int initiative = 8 * (asymmetry + kingDistance) + 12 * pawns - 120;
|
||||
int initiative = 8 * (asymmetry + kingDistance - 15) + 12 * pawns;
|
||||
|
||||
// Now apply the bonus: note that we find the attacking side by extracting
|
||||
// the sign of the endgame value, and that we carefully cap the bonus so
|
||||
|
||||
Reference in New Issue
Block a user