summaryrefslogtreecommitdiff
path: root/src/strategy
diff options
context:
space:
mode:
Diffstat (limited to 'src/strategy')
-rw-r--r--src/strategy/monte_carlo_tree.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/strategy/monte_carlo_tree.rs b/src/strategy/monte_carlo_tree.rs
index 2d27b62..24b2088 100644
--- a/src/strategy/monte_carlo_tree.rs
+++ b/src/strategy/monte_carlo_tree.rs
@@ -70,8 +70,7 @@ impl NodeStats {
fn node_with_highest_ucb<'a>(&'a mut self) -> &'a mut (Command, NodeStats) {
debug_assert!(self.unexplored.is_empty());
debug_assert!(self.explored.len() > 0);
- let total_attempts = self.explored.iter().map(|(_, n)| n.attempts).sum::<f32>();
- let sqrt_n = total_attempts.sqrt();
+ let sqrt_n = self.attempts.sqrt();
let mut max_position = 0;
let mut max_value = self.explored[0].1.ucb(sqrt_n);