Commit Graph

201 Commits

Author SHA1 Message Date
Maximilian Keßler 9af42a43a4
reduce number of map lookups 2024-02-10 00:27:00 +01:00
Maximilian Keßler 3dafee21dd
fix interactive option 2024-02-09 16:39:02 +01:00
Maximilian Keßler 5c4a2bb4f7
Store rationals without denominator
Instead of storing a rational for evey game state,
we just store how many of the factorial(draw pile size) many
game states can be won.
This allows us to save only one 64-bit integer per game state instead of
two and thus reduces memory consumption of the program significantly.
Also, this makes some computations a bit easier, since we do not have to
normalize when recursing - we can just add the numbe of winnable states
for each possible draw.

On the other hand, this means that upon lookup, we have to normalize the
stored values again to retrieve the probabilities.
In particular, one needs to know what the draw pile size of the game
state is in order to interpret the value of the state.
2024-02-09 15:58:15 +01:00
Maximilian Keßler afb6fee540
intoduce CLI option to reduce memory consumption 2024-02-08 22:08:44 +01:00
Maximilian Keßler bfc731ae36
Introduce option for HanabiState to save memory 2024-02-08 21:54:39 +01:00
Maximilian Keßler 27922de8e8
introduce function to select which states to save to map 2024-02-08 21:44:57 +01:00
Maximilian Keßler f0a496a8f0
Use parallel_hashmap library for better performance
This drastically reduces memory usage and also gains some performance.
Since this is a drop-in replacement, there is essentially no downside in
using this.
2024-02-07 19:52:02 +01:00
Maximilian Keßler 5507f8e5dc
Introduce using directive for map type
This sets up for quick testing of different maps with the same interface
2024-02-07 18:59:08 +01:00
Maximilian Keßler 3985ffaac4
fix type 2024-02-06 21:06:58 +01:00
Maximilian Keßler 80290a85f9
add missing files for version generation 2024-02-05 22:28:15 +01:00
Maximilian Keßler 9d1d27d65c
deactivate debug macro 2024-02-05 22:20:40 +01:00
Maximilian Keßler 7699b20498
CMake: Fix version generation: regenare on every build 2024-02-05 19:17:26 +01:00
Maximilian Keßler 742266fe82
Include version information into program 2024-02-03 13:21:58 +01:00
Maximilian Keßler 62aabe17f5
fix sort order 2024-02-01 22:26:24 +01:00
Maximilian Keßler 47d59464cd
backtracking: consider striking at 8 clues 2024-02-01 22:26:08 +01:00
Maximilian Keßler 863baf3acd
consider playing trash at 8 clues 2024-01-17 18:22:20 +01:00
Maximilian Keßler 03abd08418
Merge branch 'main' into cpr-fetch-content 2024-01-14 18:34:15 +01:00
Maximilian Keßler e7793907bf
remove ranges header 2024-01-14 18:34:00 +01:00
Maximilian Keßler 759386f21b
Merge branch 'main' into cpr-fetch-content 2024-01-14 18:05:08 +01:00
Maximilian Keßler 191e74e45f
Use C++17 to support older compilers 2024-01-14 18:04:27 +01:00
Maximilian Keßler c7339a4b17
lower boost requirement: 1.75 2024-01-14 16:56:11 +01:00
Maximilian Keßler 4deb33f54c
lower cmake requirement 2024-01-14 16:55:35 +01:00
Maximilian Keßler 45f7c98c60
lower boost requirement: 1.75 2024-01-14 15:12:02 +01:00
Maximilian Keßler 585d5512b6
lower cmake requirement 2024-01-14 15:10:32 +01:00
Maximilian Keßler a2d6f0a743
use fetch_content for cpr installation 2024-01-14 14:37:23 +01:00
Maximilian Keßler d6474bb19d
improve return codes 2024-01-13 14:37:16 +01:00
Maximilian Keßler b30024d5a3
improve output 2024-01-13 03:39:53 +01:00
Maximilian Keßler 84b95e7214
expand getting actions: include non-reasonable actions on request 2024-01-13 00:48:57 +01:00
Maximilian Keßler 35b78cb4db
Implement option to list all actions in replay 2024-01-12 23:21:58 +01:00
Maximilian Keßler cdf8575283
Fix id clashes: Normalize all card positions 2024-01-12 23:07:36 +01:00
Maximilian Keßler 27a45561e7
remove redundant ; 2024-01-12 19:07:48 +01:00
Maximilian Keßler 6143d199de
remove constexpr 2024-01-12 19:06:01 +01:00
Maximilian Keßler 6a663563a3
remove semicolons 2024-01-12 18:22:48 +01:00
Maximilian Keßler 4f1e41a80a
simplify code 2024-01-12 18:05:15 +01:00
Maximilian Keßler 3c1fa0d0e4
Disable integrity checks by default
This should speed up the program drastically
2024-01-12 17:40:21 +01:00
Maximilian Keßler 835bf3421b
remove print 2024-01-12 15:59:51 +01:00
Maximilian Keßler 11043d51c8
remove unneccessary prints 2024-01-12 15:19:22 +01:00
Maximilian Keßler 8398173939
implement discarding dupes and sacrifice discards 2024-01-12 15:18:30 +01:00
Maximilian Keßler 43477b1023
better state printing: ignore trash 2024-01-12 14:59:47 +01:00
Maximilian Keßler e18937c599
Revert "add card orders to deck"
This reverts commit 8b42819704.
2024-01-12 14:51:13 +01:00
Maximilian Keßler 4ba61b0450
implement criticality of cards 2024-01-12 14:27:16 +01:00
Maximilian Keßler 8b42819704
add card orders to deck 2024-01-09 15:07:14 +01:00
Maximilian Keßler c6a7eec903
fix assertions and when to consider stalling 2024-01-09 04:13:13 +01:00
Maximilian Keßler 486e459c68
handle CS games on download 2024-01-09 02:21:01 +01:00
Maximilian Keßler 5b6e877a51
add debug macro 2024-01-09 01:10:27 +01:00
Maximilian Keßler 930ba9b408
game_state: support clue starved variants 2024-01-09 01:10:19 +01:00
Maximilian Keßler c7eac217a8
Implement missing output operator 2023-11-24 16:11:36 +01:00
Maximilian Keßler 934345e076
fix clue modifier 2023-11-20 20:04:53 +01:00
Maximilian Keßler 50ddeff59a
more consistent wording in output 2023-11-17 09:28:31 +01:00
Maximilian Keßler 03a40b601f
clean up CMakeLists.txt: add tests 2023-11-17 09:28:15 +01:00