From 0218ceb789e45d03b8bbd924b626084b987da19b Mon Sep 17 00:00:00 2001 From: Jacob Van Geffen Date: Tue, 17 Dec 2024 15:02:43 -0600 Subject: [PATCH] Test global frequency --- src/game/aggregation.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/game/aggregation.rs b/src/game/aggregation.rs index 022c659..66af650 100644 --- a/src/game/aggregation.rs +++ b/src/game/aggregation.rs @@ -534,6 +534,11 @@ mod tests { if !(action_ev_weighted_sum.is_nan() && player_ev.is_nan()) { assert!((action_ev_weighted_sum - player_ev).abs() < 1e-3); } + + // Check that the global frequency is between 0 and 1 + if !row.global_frequency.is_nan() { + assert!(row.global_frequency >= 0.0 && row.global_frequency <= 1.0); + } } fn check_tree(tree: &AggActionTree, config: &TreeConfig) {