fix(bots): roll between the nearest spots so a fleet stops sharing one #246
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/fisher-spot-spread"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The spot scan ended in
Enum.min_by/3on distance, which is a clone factory:every fisher at the same water has the same scan, the same candidates and the
same answer, and
min_byis first-wins on ties against a stableMovementAuthority.nearby/3order, so a tie cannot break the symmetry either.Measured before touching it. Three fishers at Barbarian Village, sampled every
six seconds over twenty minutes: 47% of the ticks on which all three were
fishing had all three on one tile, 51% on two, and one tick in 161 on
three. Two of them held identical target indices for hundreds of ticks at a
stretch -- 132 both on 17905, 110 both on 17785, 107 both on 18180.
So take the nearest three workable spots and roll, which is the roll
Bot.Sites.choose/2already makes between grounds and the spreadBot.Sites.spot/2already gives a fleet around a booth. The spreading waswritten twice; this was the third place that needed it. Re-rolled on every
acquire rather than fixed per body, so a fleet keeps redistributing as spots
relocate under it.
Re-measured the same way: 22% of ticks on one tile, 75% on two. That is
the ceiling rather than a half-fix -- the water there carries exactly two
live spots inside the scan radius, on adjacent tiles, and three bots rolling
uniformly over two spots land on the same one 25% of the time by construction.
The observed 22% is that number. A cluster with one spot in it still shares,
which is what the game looks like anyway.
The test asserts the distribution rather than reading variety off the dice: it
seeds four spots, rolls sixty acquires, and requires both that more than one
index comes back and that the fourth -- the one outside the pool -- never
does. Checked against the old behaviour before keeping it, where it fails with
"every scan chose [32701], which is the argmin this roll replaced".