mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Introduce asymmetric SEE.
No functional change
This commit is contained in:
parent
0c1b40c5e2
commit
2097cd1221
2 changed files with 22 additions and 0 deletions
|
@ -1148,6 +1148,16 @@ int Position::see_sign(Move m) const {
|
||||||
}
|
}
|
||||||
|
|
||||||
int Position::see(Move m) const {
|
int Position::see(Move m) const {
|
||||||
|
return do_see<false>(m, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Position::see_asymm(Move m, int asymmThreshold) const
|
||||||
|
{
|
||||||
|
return do_see<true>(m, asymmThreshold);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <bool Asymmetric>
|
||||||
|
int Position::do_see(Move m, int asymmThreshold) const {
|
||||||
|
|
||||||
Square from, to;
|
Square from, to;
|
||||||
Bitboard occupied, attackers, stmAttackers;
|
Bitboard occupied, attackers, stmAttackers;
|
||||||
|
@ -1224,6 +1234,16 @@ int Position::see(Move m) const {
|
||||||
|
|
||||||
} while (stmAttackers);
|
} while (stmAttackers);
|
||||||
|
|
||||||
|
// FIXME: Document
|
||||||
|
if (Asymmetric)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < slIndex ; slIndex += 2)
|
||||||
|
{
|
||||||
|
if (swapList[slIndex] < asymmThreshold)
|
||||||
|
swapList[slIndex] = - QueenValueMg * 16;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Having built the swap list, we negamax through it to find the best
|
// Having built the swap list, we negamax through it to find the best
|
||||||
// achievable score from the point of view of the side to move.
|
// achievable score from the point of view of the side to move.
|
||||||
while (--slIndex)
|
while (--slIndex)
|
||||||
|
|
|
@ -160,6 +160,8 @@ public:
|
||||||
// Static exchange evaluation
|
// Static exchange evaluation
|
||||||
int see(Move m) const;
|
int see(Move m) const;
|
||||||
int see_sign(Move m) const;
|
int see_sign(Move m) const;
|
||||||
|
int see_asymm(Move m, int asymmThreshold) const;
|
||||||
|
template <bool Asymmetric> int do_see(Move m, int asymmThreshold) const; //FIXME: private!!
|
||||||
|
|
||||||
// Accessing hash keys
|
// Accessing hash keys
|
||||||
Key key() const;
|
Key key() const;
|
||||||
|
|
Loading…
Add table
Reference in a new issue