What is the board saying

Evaluating the Board


The evaluation of a position is rather simple.

Here , a positive value means that the computer is ahead else the player.
All values are calculated in centipawns, that is 100 points is equivalent to more-or-less one pawn.

First, there is a Material class which checks the relative piece values.

Secondly, there is a PiecePosVal class, which gives each piece a certain amount of points based on its location in the board.

Thirdly, there is a checking for doubled pawns, isolated pawns and passed pawns, where certain bonus points are either given or taken according to the pawn structure.This is but a rough approximation.
Also , there these valueBoard class considers whether it is an  endgame  position, which is set by the Material class.

There is also a  Options class which awards points for mobility. Although, the evaluation could have been simpler with more time for searching deeper, or could have been better, I think that this balance is right for adequate playability.

In the package, if you see, there is also a class called KingSafety which is not used.This is because, it was used in the first couple of versions, but it was too time consuming.Also , it does not make use of some of the additional features that I have later integrated, but if you want to add it, then just write a couple of lines in the PositionEvaluator class and call the kingSafeValue(.. ) method on the instance.
It acts on a certain Color so you will have to use it separately for both the colors.

Now, in the post "The Board Class"  I said that I would resolve why there were different methods for performing a move.The simple reason is that enpassant moves are quite a bit different that normal moves and keeping them in the same method would have resulted in loss of readability and some bugs could have crept up.




Comments

Popular posts from this blog

Small-to-Large

Segment Tree Beats - An introduction

Getting prepared for RMO