An evaluation function, also known as a heuristic evaluation function or static evaluation function, is a function used by game-playing programs to estimate the value or goodness of a position in the minimax and related algorithms. The evaluation function is typically designed to prioritize speed over accuracy; the function looks only at the current position and does not explore possible moves (therefore static).
One popular strategy for constructing evaluation functions is as a weighted sum of various factors that are thought to influence the value of a position. For instance, an evaluation function for chess might take the form
- c1 * material + c2 * mobility + c3 * king safety + c4 * center control + ...
- f(P) = 200(K-K') + 9(Q-Q') + 5(R-R') + 3(B-B'+N-N') + (P-P') - 0.5(D-D'+S-S'+I-I') + 0.1(M-M') + ...
- K, Q, R, B, N, P are the number of white kings, queens, rooks, bishops, knights and pawns on the board.
- D, S, I are doubled, backward and isolated white pawns.
- M represents white mobility (measured, say, as the number of legal moves available to White).
Evaluation functions in Go take into account both territory controlled, influence of stones, number of prisoners and life and death of groups on the board.
- Keys to Evaluating Positions
- GameDev.net - Chess Programming Part VI: Evaluation Functions
- http://alumni.imsa.edu/~stendahl/comp/txt/gnuchess.txt - Heuristic function used by GNU Chess in 1987