From e04d242a7181b6c6cae2d576cc92f8721d4ffd2e Mon Sep 17 00:00:00 2001 From: Felix Bauckholt Date: Wed, 6 Mar 2019 12:23:21 +0100 Subject: [PATCH] Bug fixes --- README.md | 4 ++-- src/strategies/information.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ae63bb0..c1c0752 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,8 @@ On seeds 0-9999, we have these average scores and win rates: |-------|---------|---------|---------|---------| |cheat | 24.8600 | 24.9781 | 24.9715 | 24.9570 | | | 90.52 % | 98.12 % | 97.74 % | 96.57 % | -|info | 22.3360 | 24.7279 | 24.8889 | 24.8991 | -| | 09.98 % | 80.48 % | 91.37 % | 92.10 % | +|info | 22.3386 | 24.7322 | 24.8921 | 24.8996 | +| | 09.86 % | 80.75 % | 91.58 % | 92.11 % | To reproduce: diff --git a/src/strategies/information.rs b/src/strategies/information.rs index 46476db..171e6b1 100644 --- a/src/strategies/information.rs +++ b/src/strategies/information.rs @@ -722,7 +722,7 @@ impl InformationPlayerStrategy { // get post-hint hand_info let mut hand_info = self.get_player_public_info(hint_player).clone(); - let total_info = 3 * (view.board.num_players - 1); + let total_info = view.get_other_players().into_iter().map(|player| self.get_info_per_player(player)).sum(); let questions = Self::get_questions(total_info, view, &hand_info); for question in questions { let answer = question.answer(hand, view); @@ -830,7 +830,7 @@ impl InformationPlayerStrategy { // TODO: make it so space of hints is larger when there is // knowledge about the cards? - let info_per_player: Vec = self.get_other_players_starting_after(self.me).iter().map( + let info_per_player: Vec = self.get_other_players_starting_after(self.me).iter().map( |player| { self.get_info_per_player(*player) } ).collect(); let total_info = info_per_player.iter().fold(0, |a, b| a + b); @@ -922,7 +922,7 @@ impl InformationPlayerStrategy { fn infer_from_hint(&mut self, hint: &Hint, result: &Vec) { let hinter = self.last_view.board.player; - let info_per_player: Vec = self.get_other_players_starting_after(hinter).iter().map( + let info_per_player: Vec = self.get_other_players_starting_after(hinter).iter().map( |player| { self.get_info_per_player(*player) } ).collect(); let total_info = info_per_player.iter().fold(0, |a, b| a + b);