1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
//! Defines the `Evaluator` trait.
use SetOption;
use Board;
use Move;
use *;
/// A trait used to statically evaluate positions.
///
/// An evaluation function is used to heuristically determine the
/// relative value of a position, i.e. the chances of winning. If we
/// could see to the end of the game in every line, the evaluation
/// would only have values of "loss", "draw", and "win". In practice,
/// however, we do not know the exact value of a position, so we must
/// make an approximation. Beginning chess players learn to do this
/// starting with the value of the pieces themselves. Computer
/// evaluation functions also use the value of the material as the
/// most significant aspect and then add other considerations.
///
/// Static evaluation is an evaluation that considers only the static
/// material and positional properties of the current position,
/// without analyzing any tactical variations. Therefore, if the
/// position has pending tactical threats, the static evaluation will
/// be grossly incorrect. To implement your own static evaluator, you
/// must define a type that implements the `Evaluator` trait.