diff options
| author | Tom Harley | 2019-04-03 20:27:37 +0100 |
|---|---|---|
| committer | Tom Harley | 2019-04-03 21:00:53 +0100 |
| commit | 6aa9e916a7420f57dbdc041cb586d0a23bb11264 (patch) | |
| tree | 97e4e6c62782b20e3434c30ff8e7ce484addedd8 /metasol.hpp | |
| parent | Remove thpool from Makefile (diff) | |
| download | metasol-6aa9e916a7420f57dbdc041cb586d0a23bb11264.tar.gz metasol-6aa9e916a7420f57dbdc041cb586d0a23bb11264.zip | |
Add indefinite running
trh/multiruncentre can now be run indefinitely, attempting to solve games incrementally, by passing it the -f flag.
Diffstat (limited to 'metasol.hpp')
| -rw-r--r-- | metasol.hpp | 55 |
1 files changed, 33 insertions, 22 deletions
diff --git a/metasol.hpp b/metasol.hpp index ba1451c..939effd 100644 --- a/metasol.hpp +++ b/metasol.hpp @@ -571,26 +571,6 @@ typedef std::vector<ms_card> ms_card_pile; ms_card ms_str_card(char *str, bool fd); /** - * Representation of a deal-in-progress. - * - * Basically just the exact status of each pile. - */ -typedef struct { - std::vector<ms_card_pile> foundations; - ms_card_pile stock; - ms_card_pile waste; - std::vector<ms_card_pile> tableau; - ms_card_pile hole; - std::vector<ms_card_pile> cells; - ms_card_pile reserve; - - /** - * The seed used for random generation of the game-state. - */ - long seed; -} ms_game_state; - -/** * Representation of a move. * * Stock moves are treated differently from regular moves. @@ -622,6 +602,32 @@ typedef struct { } ms_move; /** + * Representation of a deal-in-progress. + * + * Basically just the exact status of each pile. + */ +typedef struct { + std::vector<ms_card_pile> foundations; + ms_card_pile stock; + ms_card_pile waste; + std::vector<ms_card_pile> tableau; + ms_card_pile hole; + std::vector<ms_card_pile> cells; + ms_card_pile reserve; + + /** + * The seed used for random generation of the game-state. + */ + long seed; + + /** + * The moves made in order to get to this game-state. + */ + std::vector<ms_move> moves_made; + +} ms_game_state; + +/** * The reported status of a voter after a run. */ enum finished_state { @@ -636,7 +642,7 @@ enum finished_state { * the game-state it was given. */ NO_SOLUTION, - + /** * The voter was unable to find a solution _or_ exhaust all options before * stopping for some other reason. @@ -755,7 +761,7 @@ typedef struct { /** * How many votes are used to determine the next move. */ - unsigned max_votes; + unsigned vote_count; /** * The seed used when shuffling face-down cards around. @@ -767,6 +773,11 @@ typedef struct { */ std::default_random_engine rng; + /** + * `true` when running infinitely. + */ + bool forever; + } ms_settings; /** |
