Skip to content

Commit

Permalink
Knights center bonus
Browse files Browse the repository at this point in the history
  • Loading branch information
nionita committed Mar 28, 2024
1 parent 75c0efa commit a9f5376
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Eval/Eval.hs
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,11 @@ mobDiff p mylr yolr mypb yopb ew = mad (ewMobilityKnight ew) n .

-- This function is already optimised
-- King & minors: take extended center
-- For knights: also position on extended center
centerDiff :: MyPos -> EvalWeights -> MidEnd -> MidEnd
centerDiff p !ew = mad (ewCenterPAtts ew) pd .
mad (ewCenterNAtts ew) nd .
mad (ewCenterNOcc ew) no .
mad (ewCenterBAtts ew) bd .
mad (ewCenterRAtts ew) rd .
mad (ewCenterQAtts ew) qd .
Expand All @@ -499,6 +501,9 @@ centerDiff p !ew = mad (ewCenterPAtts ew) pd .
!mna = popCount $ myNAttacs p .&. excent
!yna = popCount $ yoNAttacs p .&. excent
!nd = mna - yna
!mno = popCount $ me p .&. excent .&. knights p
!yno = popCount $ yo p .&. excent .&. knights p
!no = mno - yno
!mba = popCount $ myBAttacs p .&. excent
!yba = popCount $ yoBAttacs p .&. excent
!bd = mba - yba
Expand Down
3 changes: 2 additions & 1 deletion Struct/Params.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ weights = [
("ewMobilityRook", ( 32, 40)), -- texel2 / o: 32, 39
("ewMobilityQueen", ( 4, 22)), -- texel2 / o: 4, 22
("ewCenterPAtts", ( 73, 57)),
("ewCenterNAtts", ( 25, 20)),
("ewCenterNAtts", ( 35, 30)),
("ewCenterBAtts", ( 25, 20)),
("ewCenterRAtts", ( 14, 22)), -- DSPSA ...
("ewCenterQAtts", ( 13, 53)),
("ewCenterKAtts", ( 0, 32)),
("ewCenterNOcc", ( 100, 0)),
("ewSpace", ( 1, 0)),
("ewAdvAtts", ( 0, 12)),
("ewWeakSq", ( -32, 0)),
Expand Down

0 comments on commit a9f5376

Please sign in to comment.