Quagnes

Latest version: v1.1.0

Safety actively analyzes 682404 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

1.1.0

Fixes Affecting Simultation Results
- No longer forbid splitting of runs between same-suit cards when the stock has two cards left, even when neither the source nor target pile can be covered by a future deal. This optimization is incorrect, ie, it could force some winning games to be reported as losses.
- Previously, splitting runs between cards of the same suit was not allowed when the stock was empty when runs are moved by suit. Add the condition that `Card(rank=last_card.rank - 1, suit=last_card.same_color_suit)` must also be in the foundation or meet the criteria for being forced to the foundation when it appears (for such splits to be forbidden), where `last_card` is the last card in the run moved. The additional condition is because placing the same-color suit at the bottom of the pile makes the pile unmovable, and so it would matter whether or not the split was performed. So we only forbid splits when this cannot be the case.

Fixes Improving Run-Time
- When checking whether a card is the last in the pile (which is used to determine whether a tableau move should be forced), we previously failed to consider the card that would become last in a pile after the move. These cards are now considered.
- Add Optimization (9) to force the last deal if the two dealt cards will immediately be forced to the foundation according to the first part of Optimization (8d). Attributes were added to the `AgnesState` class to store the last and second to last card, whether they are of the same suit in sequence, and whether they are the same color, but not the same suit.
- Add Optimization (10) to sort the tableau piles that can no longer be covered by a deal before storing in or checking against the losing states set. The piles are sorted by their top card.

Other Changes
- Add src/, bin/, obj/ directories. Rename inc/ to include/
- Fix Issue 2 (help message for print_usage function in `quagnes.cpp`)
- Change constants defined using C-style `define` statements to `const` variables and modernize notation used for these.
- Add `same_color_suit` function to `Card` structure and `InFoundation` function to `AgnesState` class.
- Mark all functions as `const` when possible.
- analysis.R: add `fill.from.nosplit` function to get wins from `NoSplit` results when `Split` simulation does not finish. Remove a footnote from the output table as there are now so few incomplete games that the rounded results are the same whether the results are wins or losses.

1.0.0

This is the initial release managed by github. Compared to the previous version (`v0.6`), the following changes have been implemented:

- Bug fix. Previous version was silently overflowing a `uint16_t` type used to store the search tree depth. This is updated to `uint32_t`.
- Change name of `split_same_suit_runs` parameter to `split_runs` and make parameter applicable regardless of the value of `move_same_suit`.
- Add Optimizations 4 and 8 described in the "Rules,-Methodology,-and-Analysis-of-Win-Ratesoptimizations" wiki page for this release. Add new attributes created for these optimizations in `AgnesState` class (`in_suit_seq`, `last_in_pile`, `all_lmi`) to output printed when state is printed.
- Add `hash` attribute to `AgnesState` class to store the string representing the hash of the object that will be stored in the losing states and
check loop set. Add `Agnes_state.UpdateHash()` function called after move is performed or undone to save the string in `hash`. Previously, the `hash` was recalculated multiple times.
- Use a single set to track whether loop has occurred rather than a stack of sets. Save result of check whether state is in the losing states set so that we do not inefficiently (re-)insert the state into the losing states set. Add attributes `is_loop` and `is_loser` to `AgnesState` class to support this logic.

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.