Commit Graph

33 Commits

Author SHA1 Message Date
timotree3
5585ca54cb Update results table after disallowing 8 clues discards 2023-01-19 22:42:52 -05:00
timotree3
da6dffca0c Update results table
Changes are probably due to updated rand dependency
2023-01-19 22:33:28 -05:00
Jeff Wu
cf65b0e158 updates for FAIR work 2019-12-09 10:12:31 -08:00
Jeff Wu
b8ea5d4ad5
bragging 2019-05-26 23:59:42 -07:00
Felix Bauckholt
1c229227ab Merge branch 'master' into information-efficiency 2019-03-15 14:23:09 +01:00
Felix Bauckholt
9364a06862 Improve ask_question strategy
I also replaced the callback architecture behind
`PublicInformation.ask_questions()` with a simpler method
`PublicInformation.ask_question()` that gets called repeatedly.

To make all float-based sorts easier, I used the `float-ord` package.
I also used it to clean up some of the sorting in `decide_wrapped()`.
2019-03-15 13:45:17 +01:00
Jeff Wu
c791adcb5a make readme slightly nicer 2019-03-10 22:31:20 -07:00
Felix Bauckholt
8fd230da1c Report standard errors in README.md 2019-03-10 22:20:25 -07:00
Felix Bauckholt
051ac7a097 Modulus magic!
Suppose we have `total_information` choices, and we first use them to
encode the answer `x` to a question with `m` answers. That answer is encoded
by the choice we take modulo `m`.

How much "information" do we have left? That depends on the number of
numbers less than `total_information` that are equal to `x` modulo `m`.
Depending on the value of `x`, this is either
`floor(total_information/m)` or `floor(total_information/m) + 1`.

We now use all of this information as opposed to just
`floor(total_information/m)`, at the cost of making our math not a lot
more complicated but pretty confusing.
2019-03-07 22:48:14 +01:00
Felix Bauckholt
8ed01d47ca Slight changes to be more information-efficient
- If a player discards because nobody else needed a hint, that
  information is "transmitted" before they transmit other info through
  hat stuff.
- The "card possibility partition" questions now take into account info
  learned through earlier questions.
2019-03-07 22:29:20 +01:00
Felix Bauckholt
493631dad0 Refactor out a "public information object"
One important change is that now, when deciding which questions to ask, they can see the answer to the last question before asking the next one.

Some design choices:
- Questions now take a BoardState instead of an OwnedGameView.
- When deciding which questions to ask (in ask_questions), we get an immutable public information object
  (representing the public information before any questions were asked), and a mutable HandInfo<CardPossibilityTable>
  that gets updated as we ask questions. That HandInfo<CardPossibilityTable> was copied instead of taken.
- In ask_questions, we also get some &mut u32 representing "info_remaining" that gets updated for us.
  This will later allow for cases where "info_remaining" depends on the answers to previous questions.
- Both get_hint_sum and update_from_hint_sum change the public information object. If you want to compute the
  hint sum but aren't sure if you actually want to give the hint, you'll have to clone the public information
  object!
- Over time, in the code to decide on a move, we'll be able to build an increasingly complicated tree of
  "public information object operations" that will have to be matched exactly in the code to update on a move.
  In order to make this less scary, I moved most of the code into
  "decide_wrapped" and "update_wrapped". If the call to update_wrapped
  (for the player who just made the move) changes the public information
  object in different ways than the previous call to decide_wrapped, we
  detect this and panic.

This commit should be purely refactoring; all changes to win-rates are
due to bugs.
2019-03-07 22:04:06 +01:00
Felix Bauckholt
e510f7cc5e Switch around ordering of question combining
This has the advantage that for some ModulusInformation object m and
some modulus,

```
a = m.split(modulus);
m.cast_down(x);
```

is equivalent to

```
m.cast_down(x*modulus);
a = m.split(modulus);
```

This means that when using a ModulusInformation object to answer
questions, we can answer the first question without needing to know how
many questions there are.
2019-03-07 21:52:33 +01:00
Felix Bauckholt
8337c61ea2 Auto-update README.md with cargo run --release -- --write-results-table 2019-03-07 19:12:31 +01:00
Felix Bauckholt
e04d242a71 Bug fixes 2019-03-06 12:23:21 +01:00
Felix Bauckholt
35502541a2 If a player discards because nobody needed a hint, make that common knowledge
"Needing a hint" is defined as having a playable card, but not knowing
any specific card is playable. Thus, if a player doesn't know any
playable cards and someone else discards, the player (publicly)
concludes that all their cards are unplayable.
2019-02-26 22:51:04 -08:00
Felix Bauckholt
7ace892f40 Make better decisions between hinting and discarding
I think most of the gains of this change come from the fact
that now we don't discard any potentially useful cards if we have more
than 4 hints remaining.
2019-02-26 22:51:04 -08:00
Felix Bauckholt
385feeb6ba Slight tweaks that increase 3-player win rate to 75%
- When there are less than 5 players, and we're near the discard threshold, prefer
  hinting over discarding, even if there are known useless cards.

- We now ask questions like "what's the first playable card in this list?"

  This means that if a playable card is in the asking player's list,
  the player will learn that it's playable, and that every card before
  it is not playable.

  Additionally, if a player doesn't know of any dead cards in their hand
  and there is enough information available, we use this mechanism so that
  if the player doesn't have a playable card, they will learn about one
  dead card in their hand.

(These were two commits that got joined in a rebase accident, sorry.)
2019-02-21 10:19:54 -08:00
Jeff Wu
bd3824dc7d
Fix broken table 2018-03-23 19:29:59 -07:00
Jeff Wu
cab576f883 minor cleanups 2016-04-04 00:49:10 -07:00
Jeff Wu
d86136889d only ask about playability when needed 2016-04-03 20:57:31 -07:00
Jeff Wu
b19e6ff615 update readme 2016-04-02 14:56:40 -07:00
Jeff Wu
81427e2dd5 smart hinting, silencing/configuring of progress output 2016-04-02 13:51:18 -07:00
Jeff Wu
7f5e32699e various cleanups, fixes 2016-04-02 12:35:53 -07:00
Jeff Wu
ec1fd2eb07 make color = char 2016-03-31 10:36:13 -07:00
Jeff Wu
58c881130a fix sorting wrong order bug... some cleanup, update results 2016-03-31 09:37:50 -07:00
Jeff Wu
38bb323d91 more improve 2016-03-30 23:18:55 -07:00
Jeff Wu
0aad4dfa1c choose index dynamically, use OwnedGameView where possible 2016-03-30 10:28:15 -07:00
Jeff Wu
21e2d05e93 better partitioning, fix card table bug with extra 0 entries 2016-03-30 02:52:03 -07:00
Jeff Wu
79051b51fc tweaks 2016-03-30 02:20:34 -07:00
Jeff Wu
ea2857a9cd make use of dead card discard info 2016-03-30 01:11:41 -07:00
Jeff Wu
9494d549ae make risky plays 2016-03-30 00:38:02 -07:00
Jeff Wu
3d318340eb improve to 24.78 (for 5 players) 2016-03-29 22:59:14 -07:00
Jeff Wu
107d585b19 improvements, cleanup, readme 2016-03-19 14:24:22 -07:00