Bug fixes

This commit is contained in:
Felix Bauckholt 2019-03-06 12:23:21 +01:00
parent 5540d1c4c6
commit e04d242a71
2 changed files with 5 additions and 5 deletions

View File

@ -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:

View File

@ -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<Player> = self.get_other_players_starting_after(self.me).iter().map(
let info_per_player: Vec<u32> = 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<bool>) {
let hinter = self.last_view.board.player;
let info_per_player: Vec<Player> = self.get_other_players_starting_after(hinter).iter().map(
let info_per_player: Vec<u32> = 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);