This method explains in words the meaning of the $result array, which is to say, why a particular evaluation would favor White or Black.
The thing is the $result array is typically calculated based on a discrete difference between both forces. So for example, if both White and Black have two far advanced pawns, the difference will be zero and it'll be assumed that there is no advantage for each player in terms of this particular heuristic.
However, the elaborate() method needs to be implemented in order to describe what is going on. Thus, if both White and Black have two advanced pawns, the elaborate() method will just return a description: "a7, e7, c2, e2 are far advanced pawns".
The
explain()
method implemented in the heuristic evaluations is intended to explain chess positions in terms of chess concepts.See:
This method explains in words the meaning of the
$result
array, which is to say, why a particular evaluation would favor White or Black.The thing is the
$result
array is typically calculated based on a discrete difference between both forces. So for example, if both White and Black have two far advanced pawns, the difference will be zero and it'll be assumed that there is no advantage for each player in terms of this particular heuristic.However, the
elaborate()
method needs to be implemented in order to describe what is going on. Thus, if both White and Black have two advanced pawns, theelaborate()
method will just return a description: "a7, e7, c2, e2 are far advanced pawns".Happy learning!