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
use super::*;
impl<P: Player, A: Action, S: GameState<P,A>> MCTS<P, A, S> {
pub fn with_exploration(mut self, exploration: f32) -> Self {
assert!(exploration > 0.0,"A positive value is required for the exploration constant.");
self.exploration = exploration;
self
}
pub fn with_expansion_minimum(mut self, expansion: u32) -> Self {
assert!(expansion > 0,"The value for expansion minimum must be greater than zero.");
self.expansion = expansion;
self
}
pub fn with_custom_evaluation(mut self) -> Self {
self.use_custom_evaluation = true;
self
}
pub fn with_transposition(mut self) -> Self {
self.use_transposition = true;
self
}
pub fn with_entropy(mut self) -> Self {
use rand::SeedableRng;
self.rand = Rng::from_entropy();
self
}
}