Repository navigation
Stronger engine: cover rule for the Destroyer hunt, a placer that hides ship by ship, a model of reused fleets - #13
Merged
Conversation
…er-ship weights, compare with several shooters, hunt probe
…e lines of play in the search
… learned belief; hiding placer with fade and top settings
…learned belief; experimental switches removed
…ding placer; placer tuning options listed
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Shooting: the cover rule. A game lasts until the last ship is found, and most games end with a hunt for the Destroyer alone. Finding a two-cell ship is a covering problem, so while no hit is open the engine now prefers cells of a smallest set that touches every place the Destroyer can still be (minimum vertex cover by bipartite matching,
ai/cover.rs). Such a cell counts as 10 points likelier to be a hit; the search plays its lines the same way. The bonus is a fixed amount, so a cell that a learned belief makes far likelier is still shot first. The rule also holds under a learned belief.Placement: hiding ship by ship. The adaptive placer records when the opponent's hunting reaches each cell and places a fleet whose best-hidden ship would be found latest; a bandit chooses between that and the equilibrium mix. The earlier placer stays available as
latenessto measure against.Learning: reused fleets. Per ship, the engine counts where it lay in earlier games and trusts the counts only as far as they predicted the next fleet better than assuming nothing (
ai/repeats.rs). The play page starts at a 20% belief, because it offers the player's last fleet again.Tools.
compare A [A2 ...] Bmeasures several shooters against the last one;repeat/repeatNplacers;hunt_probeexample that logs every decision for the hit-value analysis.Measurements (all on the 24-core Windows box)
Cover rule, shots saved per game against the same engine without it, same layouts:
* measured with earlier forms of the rule (only cover cells shot, or their chance doubled). On the same 30,000 layouts the doubling form and the present one differ by 0.002 shots.
Hiding placer, Broadside (3,000 placements) against the density bot with random placement: 82.7% ± 0.4 of games in matches of 100 (earlier placer 64.3%, random placement 50.9%); 67.8% against 58.6% in matches of 10.
Repeat model, shots saved: 4.91 ± 0.09 against a new fleet every 3 games (6.10 with the play page's 20% belief), 0.00 against random placement and the equilibrium mix (−0.06 ± 0.03 with the 20% belief).
Known limits
Checks
cargo fmt --all --check,cargo clippy --all-targets -- -D warnings,cargo test --release(71 tests),cargo test --release -- --ignored,npm run checkandnpm run buildinsite/: all pass.