The seating tries a party side by side first and works down a ladder when it cannot: all adjacent, then the same row with gaps, then the same area, then the same section, then scattered. Every rung but the last was about how CLOSE the places are, and none of them counted how many PIECES the party ends up in. So the last rung handed out places in order: a party of three with a row of singles got three seats each between strangers, while a pair and a single across two sections was there to be had and could not be preferred.

There is now a rung between taking a fresh run and spreading. It seats the party in as few unbroken pieces as the house can be broken into, crossing areas if that is what it takes. Fewest pieces first, then closest: two threes in two areas beat six singles sharing a row, and two threes in one row beat two threes in two areas. Which stretches the pieces are cut from needs no search, since the longest of them taken until they cover the ask is as few of them as any choice could be.

How long each piece is does need deciding, and evenly is the answer, because a party of six broken in two would rather be two threes than a five and one person on their own. The rule on leaving no place on its own narrows what each piece may take, which is why the lengths are worked out rather than dealt out: a stretch of four, in a house that leaves no place on its own, can give one, two or all four of its seats and never three. Spreading stays the floor under the new rung, since it hands a whole part of the house to the share-out at once and can price a party across tariffs that cannot be priced piece by piece.

Nothing new is read. The rung groups what it was handed by row, by area and by section, which is the same arithmetic spreading already does over the same list, and #3616896: Seat a party under the hold's own locks, so a rush is served rather than refused had already left the whole of the party's reach in hand by the time it is asked.

The two things this issue left to settle. How a party in several pieces ranks against one seated whole in a worse part of the house needed no new rule: a fresh run is searched for across the whole house before this rung, so one run anywhere always wins and the rung only runs when none exists. What the booker is told is unchanged, and deliberately: the notice says how far apart the places are, which is true of two threes in a row as much as of six seats on their own, and a count in that sentence is one the booker cannot reconcile with anything on their screen. The strategy's own description did change, because it promised to spread a party where the house has no run long enough, which is no longer what it does.

Pieces rather than groups throughout the code and the documentation, since a group is already what a booking is for.

AI-Generated: Yes (Claude Code was used to draft this issue summary and to write the code on its merge request. I reviewed both before posting.)

Issue fork yoyaku-3617891

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review

  • mably committed 87939797 on 1.x
    feat: #3617891 Seat a party that cannot sit together in as few groups as...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mably’s picture

Title: Seat a party that cannot sit together in as few groups as possible, across areas if need be » Seat a party that cannot sit together in as few pieces as possible, across areas if need be
Issue summary: View changes

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.