Extracting features from chessboard So i am implementing an intelligent chess agent with the use of reinforcement learning.I intend to use Java.

After reading the master thesis of H.Mannen i decided to use some of the features listed on Appendix B of his master that can be found on page 67.

Edit- Description of the features:

-Board control : amount of empty squares controlled by a side

-Connectivity : amount of connectedness between the pieces of a side

-King’s distance to center amount of squares a king is separated from one of the center squares e4, d4, e5, d5

-Total mobility : total sum of squares reachable by a side

-Center control : amount of pawns occupying the squares e4, d4, e5, d5.

-Isolated pawns : amount of pawns without a pawn of its own side on an adjacent line.

-Doubled pawns : amount of pawns, greater than 1, on 1 line. 

-Passed pawns : amount of pawns without an enemy pawn ahead of it on the same or an adjacent line.

-Pawn forks : amount of pawns which attack two superior pieces.

Due to the fact that my project is focused on the AI part of the chess agent i would like to use some preexisting open source Java libraries or functions that automate the proccess of extracting these features from the chessboard.

After searching, the only thing i found was Chesspresso but it comes with no tutorial and i was unable to find one. So i have two questions:

-Do you know any good tutorials for Chesspresso?

-Are aware of any Java open source library that will help me extract the features i want from the chessboard so i can reduce the programming cost of the project?

Thanks in advance.
While I certainly don't know every Java library for chess, I'd be surprised to see a library designed to extract features like what you describe. There shouldn't be one because nobody else needs it.

Fortunately, everything you said is implemented and more or less there, but you'll have to do some works. You should consider to use an open-source project that has bitboard implemented (such as Droidfish or any Java engine uses bitboards). You'll need to learn how to use bitboards, but you'll find it useful to do what you want to do.

For example, you can get total mobility by masking the attacking pieces with the opponent pieces, something like:

(squares attacked by my pieces on an empty board) &amp; (their pieces)


As another example, we can get board control by:

(squares attacked by my pieces on an empty board) &amp; !(squares attacked by their pieces on an empty board)


For the documentation on Chesspresso, I doubt there is anything better than it's Java docs. You'll need to learn to read their documentation.