Commit graph

30 commits

Author SHA1 Message Date
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
96da95dbba Oops I had accidentally left bogus numbers in the last commit
Sorry :(
2019-03-07 21:38:55 +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
ef860fa73b Make runs reproducible by replacing HashMaps with FnvHashMaps 2019-03-07 13:54:30 +01:00
Jeff Wu
cab576f883 minor cleanups 2016-04-04 00:49:10 -07:00
Jeff Wu
f2de390e0e moving stuff around
- add hand info
- don't manage info in game views
- prevent deck size cheat
- rearrange stuff
2016-04-04 00:07:11 -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
58c881130a fix sorting wrong order bug... some cleanup, update results 2016-03-31 09:37:50 -07:00
Jeff Wu
0aad4dfa1c choose index dynamically, use OwnedGameView where possible 2016-03-30 10:28:15 -07:00
Jeff Wu
efba24d6e8 beginnings of information strategy 2016-03-27 10:47:58 -07:00
Jeff Wu
9c580ecb88 new cardinfo trait, separate cards stuff to different file 2016-03-22 21:45:24 -07:00
Jeff Wu
e49cb29592 configurable strategy 2016-03-20 12:40:27 -07:00
Jeff Wu
107d585b19 improvements, cleanup, readme 2016-03-19 14:24:22 -07:00
Jeff Wu
e36700d93f no empty hints, by default 2016-03-19 00:39:34 -07:00
Jeff Wu
e371e2f112 add nthreads option, histogram 2016-03-17 23:10:38 -07:00
Jeff Wu
706f5b52b6 another layer of indirection, prep for threading 2016-03-16 23:07:21 -07:00
Jeff Wu
0b9734c20b replicated 24.88 from paper 2016-03-13 22:28:34 -07:00
Jeff Wu
7f5feacbc7 command line parsing 2016-03-13 18:11:20 -07:00
Jeff Wu
adaa513ff8 cheating strategy improvements 2016-03-13 17:26:12 -07:00
Jeff Wu
6184fcd914 make rng seedable 2016-03-13 11:28:26 -07:00
Jeff Wu
2f6dc571c2 strategy that cheats, first pass 2016-03-13 01:07:34 -08:00
Jeff Wu
1ad4f9b825 improvements to strategies API
make strategies its own module
use trait objects so you can mix and match strategies
stop using internal state associated type..
2016-03-10 22:26:32 -08:00
Jeff Wu
b4d949ff2f move stuff to boardstate 2016-03-06 21:44:17 -08:00
Jeff Wu
49627b91b6 hints and better logging 2016-03-06 16:50:09 -08:00
Jeff Wu
a44b017eae add types for information 2016-03-06 03:33:14 -08:00
Jeff Wu
55e9dc2fe3 add some logging, fix some bugs 2016-03-06 01:35:19 -08:00
Jeff Wu
e2eebcbe07 sorta working, probably very buggy 2016-03-06 01:09:24 -08:00
Jeff Wu
9508a20082 flushed out game initialization 2016-03-05 19:36:02 -08:00
Jeff Wu
4168800875 Initial commit 2016-03-05 16:54:46 -08:00