@@ -18,8 +18,9 @@ type AdditionalModifier struct {
1818}
1919
2020type GamephaseWeights struct {
21- Material map [dragontoothmg.Piece ]int
22- PieceSquareTables map [dragontoothmg.Piece ][64 ]int
21+ Material map [dragontoothmg.Piece ]int
22+ PassedPawnModifier [64 ]int
23+ PieceSquareTables map [dragontoothmg.Piece ][64 ]int
2324}
2425
2526type Weights struct {
4950 dragontoothmg .Queen : 900 ,
5051 dragontoothmg .King : 0 ,
5152 },
53+ PassedPawnModifier : [64 ]int {
54+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
55+ 10 , 10 , 10 , 10 , 10 , 10 , 10 , 10 ,
56+ 20 , 20 , 20 , 20 , 20 , 20 , 20 , 20 ,
57+ 40 , 40 , 40 , 40 , 40 , 40 , 40 , 40 ,
58+ 60 , 60 , 60 , 60 , 60 , 60 , 60 , 60 ,
59+ 80 , 80 , 80 , 80 , 80 , 80 , 80 , 80 ,
60+ 100 , 100 , 100 , 100 , 100 , 100 , 100 , 100 ,
61+ 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
62+ },
5263 PieceSquareTables : map [dragontoothmg.Piece ][64 ]int {
5364 dragontoothmg .Pawn : [64 ]int {
5465 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ,
@@ -116,11 +127,13 @@ var (
116127
117128var (
118129 midgameWeights = GamephaseWeights {
119- Material : weightsForAllPhases .Material ,
120- PieceSquareTables : weightsForAllPhases .PieceSquareTables ,
130+ Material : weightsForAllPhases .Material ,
131+ PassedPawnModifier : weightsForAllPhases .PassedPawnModifier ,
132+ PieceSquareTables : weightsForAllPhases .PieceSquareTables ,
121133 }
122134 endgameWeights = GamephaseWeights {
123- Material : weightsForAllPhases .Material ,
135+ Material : weightsForAllPhases .Material ,
136+ PassedPawnModifier : weightsForAllPhases .PassedPawnModifier ,
124137 PieceSquareTables : map [dragontoothmg.Piece ][64 ]int {
125138 dragontoothmg .Pawn : weightsForAllPhases .PieceSquareTables [dragontoothmg .Pawn ],
126139 dragontoothmg .Knight : weightsForAllPhases .PieceSquareTables [dragontoothmg .Knight ],
@@ -160,7 +173,8 @@ var (
160173 },
161174 game .Black : Weights {
162175 Midgame : GamephaseWeights {
163- Material : midgameWeights .Material ,
176+ Material : midgameWeights .Material ,
177+ PassedPawnModifier : flipPstArrayVertically (midgameWeights .PassedPawnModifier ),
164178 PieceSquareTables : map [dragontoothmg.Piece ][64 ]int {
165179 dragontoothmg .Pawn : flipPstArrayVertically (midgameWeights .PieceSquareTables [dragontoothmg .Pawn ]),
166180 dragontoothmg .Knight : flipPstArrayVertically (midgameWeights .PieceSquareTables [dragontoothmg .Knight ]),
@@ -171,7 +185,8 @@ var (
171185 },
172186 },
173187 Endgame : GamephaseWeights {
174- Material : endgameWeights .Material ,
188+ Material : endgameWeights .Material ,
189+ PassedPawnModifier : flipPstArrayVertically (endgameWeights .PassedPawnModifier ),
175190 PieceSquareTables : map [dragontoothmg.Piece ][64 ]int {
176191 dragontoothmg .Pawn : flipPstArrayVertically (endgameWeights .PieceSquareTables [dragontoothmg .Pawn ]),
177192 dragontoothmg .Knight : flipPstArrayVertically (endgameWeights .PieceSquareTables [dragontoothmg .Knight ]),
0 commit comments