Commit Graph

42 Commits

Author SHA1 Message Date
b966475045
Fix: Allow user to strikeout 2024-03-15 14:57:38 +01:00
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
afb6fee540
intoduce CLI option to reduce memory consumption 2024-02-08 22:08:44 +01:00
bfc731ae36
Introduce option for HanabiState to save memory 2024-02-08 21:54:39 +01:00
27922de8e8
introduce function to select which states to save to map 2024-02-08 21:44:57 +01:00
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
863baf3acd
consider playing trash at 8 clues 2024-01-17 18:22:20 +01:00
191e74e45f
Use C++17 to support older compilers 2024-01-14 18:04:27 +01:00
84b95e7214
expand getting actions: include non-reasonable actions on request 2024-01-13 00:48:57 +01:00
35b78cb4db
Implement option to list all actions in replay 2024-01-12 23:21:58 +01:00
cdf8575283
Fix id clashes: Normalize all card positions 2024-01-12 23:07:36 +01:00
4f1e41a80a
simplify code 2024-01-12 18:05:15 +01:00
4ba61b0450
implement criticality of cards 2024-01-12 14:27:16 +01:00
930ba9b408
game_state: support clue starved variants 2024-01-09 01:10:19 +01:00
ea881c5e6a
reformat code 2023-11-16 16:20:04 +01:00
3244213daa
Split GameState into multiple files
This now allows to import a light-weight header containing
the abstract interface separately from the templated header
that manages the actual backtracking, thus speeding up compilation.
2023-11-15 22:58:09 +01:00
0dbeb6e202
remove unused hash function 2023-11-15 22:09:34 +01:00
ac4cf5e797
Fix unique ids to allow for discarded / lost cards 2023-11-14 14:32:49 +01:00
d3328725c7
better output in case of too short replays 2023-11-12 18:32:19 +01:00
32af52ae9e
Rework CLI
This should cover all use cases / exceptions now and is in a reasonably
good code state.
2023-11-12 17:30:44 +01:00
a615733350
Fix: Correctly handle bombing of cards and reverting thereof 2023-11-11 22:52:28 +01:00
5308eeaf6e
rework moving forward/backward in game 2023-11-11 22:32:30 +01:00
571011d7b5
Revert "add more checks: same draw pile after reverting single moves (bug detected)"
This reverts commit a3972fe637.
2023-11-11 13:32:18 +01:00
b9b73406f2
bugfix: have switch for card cycling in play/discard methods as well 2023-11-11 13:07:15 +01:00
a3972fe637
add more checks: same draw pile after reverting single moves (bug detected) 2023-11-11 12:41:14 +01:00
5b0834bc22
bugfix: card cycling on reverting only used internally
This ensures that when doing a regular revert,
we revert to exactly the same state (i.e. also identical
ordering of draw pile by default)
and only rotate the draw pile in case we ensure internally
that we iterate over all possible draws so that the ordering
is restored in the end.
2023-11-11 12:15:54 +01:00
b6a2dfb855
add integrity check for draw pile 2023-11-11 11:44:37 +01:00
59709e2375
rework -r option: solve state in reverse order 2023-11-11 11:44:06 +01:00
8f6d8c68fe
add option to analyze all different clue counts 2023-11-11 01:27:54 +01:00
280833ff1f
add options to alter clue counts 2023-11-11 00:01:18 +01:00
6dd2b07c09
game state: fix taking actions: rotate draw correctly 2023-11-10 21:42:09 +01:00
9af6ef3368
rework downloading interface: return game consisting of state and actions 2023-11-10 20:35:05 +01:00
4e67ffa9ee
Add optional argument to define score being optimized for
A third CLI argument is now accepted, describing a score goal.
The program will then treat reaching this score as a win and
calculate lines optimized for this score, ignoring any (possible)
higher scores.
2023-11-04 13:02:16 +01:00
87c429e586
remove extra ; 2023-10-13 00:18:08 +02:00
b69cb6d974
Rework probability printing
Outputting of probabilities is now done in unified way.
This ensures that we can handle both rational and floating-point
probabilities in all program parts properly.

The compile-time macro
NUSE_RATIONAL_PROBABILITIES
can now be defined to use floating-point probabilities instead
of real rational ones.

Using floating-point results in roughly 10% speedup.
2023-10-02 12:37:24 +02:00
0cc069485d
CLI: align action probabilities in output 2023-09-26 23:20:49 +02:00
05d348b7e4
correct action parsing 2023-09-14 17:06:06 +02:00
849c0a6538
change some types 2023-08-12 19:55:10 +02:00
38e99cf662
remove unused card operators 2023-08-12 19:46:14 +02:00
70a6000884
clean up imports 2023-08-12 19:43:22 +02:00
b1c1f41c6e
add cli command to dump id parts 2023-08-12 18:48:01 +02:00
46554a7e33
split into src and include folder 2023-08-12 11:44:56 +02:00