Repository navigation
Shooter expects an opponent who hides from its hunt; placer notices a shooter who does - #21
Merged
Merged
Conversation
…s hunt as it came
…me (the bandit is gone); README: opponents who hide from the hunt
|
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
Shooter: a model of an opponent who hides from the hunt (
crates/core/src/ai/hiding.rs)An opponent who watches the engine's shots sees the order of some 45 cells per game; the engine sees 17 cells of a fleet. A placer that moves its ships to where the hunt came late cost the engine close to 3 shots a game over matches of 100 and more than 4 over matches of 10.
The engine knows its own shots, so it now keeps the record such an opponent would keep and scores, on every revealed fleet, views that expect ships where that record would send them. The views are trusted only as far as they have predicted better than assuming nothing.
Shooter::learnnow also receives the shots fired (what the opponent saw); the browser session records them.hide=N(thousandths) sets the starting belief,hide=0turns the model off.Placer: judged after each game, no bandit (
AdaptivePlacer)Against a shooter that expects hiding, a placer that keeps hiding is read (44.0 shots needed against it, fewer than against the equilibrium mix). The bandit on the shots of single games could not see that. After each game the placer now asks what fleets of both kinds (hidden by its record as it stood, drawn from the equilibrium mix) would have been worth against the hunt as it came, and places by which kind has done better of late.
Tools
compare --match N: the error bar counts matches, not games.examples/match_probe.rs: a diagnostic for long matches (shots by stretch of the match, how concentrated each ship's places are).Measurements
All on the 24-core Windows machine, search up to 3,000 placements unless noted.
Shooter model, mean shots needed:
broadside(this PR's placer)broadside(this PR's placer)latenesslatenessmain: 48.35 to 43.12, saved 5.2 ± 0.3 (3,000 games).tilt20.00 ± 0.01,spaced0.01 ± 0.02.repeat3−0.05 ± 0.02 (the repeat model gains 4.9 there). A starting belief of 0.1% removes it but gives back 0.56 of the gain against the hiding placer, so 1% stays.Placer, Broadside against the density bot (10,000 games each):
main(bandit)Placer in self-play, both shooters with the new model (8,000 games each): against the bandit version 51.7% ± 0.6 (matches of 100) and 53.8% ± 0.5 (matches of 10); against
lateness50.6% ± 0.5; against the equilibrium mix 49.2% ± 0.6.Known limits
latenessrow was measured beforecomparecounted matches for its error bar, so its ± is somewhat too small.Checks
cargo fmt --all --check,cargo clippy --all-targets -- -D warnings,cargo test --release(75 tests),cargo test --release -- --ignored(3),npm run checkandnpm run buildinsite/: all pass locally. The browser end-to-end tests run in CI.