From bb208dfdebb7dead0e7d68e837c37972498c22d5 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Sat, 2 Jun 2018 13:09:13 +0200 Subject: Moved replay-based test to have convenience import from game engine replay --- src/strategy/monte_carlo.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/strategy/monte_carlo.rs') diff --git a/src/strategy/monte_carlo.rs b/src/strategy/monte_carlo.rs index cd4dc35..c2f3561 100644 --- a/src/strategy/monte_carlo.rs +++ b/src/strategy/monte_carlo.rs @@ -146,8 +146,8 @@ impl CommandScore { self.next_seed = next_seed; } - fn win_ratio(&self) -> u32 { - self.victories * 1000 / self.attempts + fn win_ratio(&self) -> i32 { + (self.victories as i32 - self.defeats as i32) * 10000 / (self.attempts as i32) } fn init_command_scores(settings: &GameSettings, state: &GameState) -> Vec { -- cgit v1.2.3