TabbycatDebate / tabbycat

Debating tournament tabulation software for British Parliamentary and a variety of two-team parliamentary formats
https://tabbycat.readthedocs.io/
GNU Affero General Public License v3.0
245 stars 827 forks source link

Tabbycat enforcing institution and team conflicts when disabled #1587

Closed 0zlw closed 4 years ago

0zlw commented 4 years ago

We have the following settings on but Tabbycat has done both an institution and team history conflict during the tournament.

image

Using 2.4.5-XSG

image

tienne-B commented 4 years ago

Bubble-up bubble-down does not make much sense without using conflicts. Allocations use penalties to match within brackets, but then uses a pull-up generator to decide which teams to change brackets (resolve odd brackets).

You may want to use intermediate brackets instead. What bubble-up/down does is just check if there are conflicts and swaps to avoid them, so co-efficients on penalties are not taken into account. If we add co-efficients, the pull-up generator would fail in your case, but more generally would be a new generator with a dynamic approach to minimize the "badness" of the brackets. This would be a much bigger project though and am unsure of how much it would be worth with the options we already have.

0zlw commented 4 years ago

Sorry I think you may have misunderstood the nature of the bug report.

The issue I was reporting is that we did not have "avoid institution" or "avoid same team" enabled, yet Tabbycat was applying one up one down to avoid this.

I.e. when you say "Bubble-up bubble-down does not make much sense without using conflicts" - this is exactly the problem we had. Conflicts were off but for some reason bubble up bubble down occurred.

czlee commented 4 years ago

@0zlw If you change the odd bracket resolution method to "Intermediate brackets", does that produce the desired behaviour?

(The odd bracket resolution method doesn't check any of the draw conflict options, it just implements the bubble-up-bubble-down procedure in the Australs constitution directly. Since that's very explicitly defined, there's no freedom to optimise it in the way there is for Tabbycat's one-up-one-down (within brackets) algorithm.)

0zlw commented 4 years ago

Ah sorry I've just reread and I understand that the bubble up/bubble down intermediate setting is the issue as this ignores the team history/institution checkboxes.

The issue I then think this could lead to given the literal implementation of the Australs method is if people have one of institution/team conflict on but the other setting off neither intermediate nor intermediate with bubble leads to the desired result. This would likely be a common setting at a tournament with a small number of institutions competing - it would not be feasible to enforce institution conflicts but might enforce history conflicts.

czlee commented 4 years ago

Yeah, I'd describe this more as a usability issue than a functionality issue. Let me explain. It's a little complicated. It might sound odd that I'm about to explain Australs rules for a tournament that isn't running Australs rules, but bear with me. It explains why odd bracket resolution is relevant.

There are two ways in which the Australs constitution tries to prevent teams (at Australs) from hitting their own institution or a previous opponent:

  1. Within a normal bracket, it specifies that once the slide pairings are done, teams hitting their own institution or a previous opponent should be swapped with the room above or below them within their bracket, so long as that's an improvement. Teams may only be swapped within their brackets—crossing bracket lines isn't allowed. This is known as the "one-up-one-down" procedure, and it's been in place at least as long as I've been around Australs (👴🏻😅).
  2. When intermediate brackets are in play, the one-up-one-down procedure doesn't make any sense, because all intermediate brackets by definition have two teams. So when they introduced intermediate brackets (c. 2014), they also introduced a mechanism to permit swaps out of intermediate brackets, where the two intermediate bracket teams are from the same institution or have already faced each other, to the top room below or the bottom room above. Remember, this is not the one-up-one-down procedure, because that's not allowed to cross bracket lines. We call this part of the pairing procedure the "bubble-up-bubble-down procedure'.

The two provisions have the same objective, but procedurally they're very different. One-up-one-down applies only after you've figured out who's in each bracket, so has nothing to do with odd bracket resolution. It's actually a completely separate step in draw generation. Bubble-up-bubble down, by contrast, is part of determining who's in each bracket: it's part of the intermediate bracket procedure. Since intermediate brackets are an "odd bracket resolution method", this makes bubble-up-bubble-down part of odd bracket resolution.

If you're running Australs rules with intermediate brackets, then you need both. If you don't want any own-institution or history avoidance, then you want neither.

When I implemented this, it sort of crossed my mind that it might get confusing for someone who didn't realize that the two options were distinct, and normally you'd want both or neither. But basically it was tricky to implement as it was, and I thought the code would get even more confusing if we fed the penalty options into a part of the code (bubble-up-bubble-down) that doesn't even try to use penalties. So there's probably a case to be made that we should clean up these options to make them simpler to use, or maybe have warnings to protect against unwise configurations. But this is part of more systemic issues with options that we don't have a good handle on what to do with yet; see #988.

(I wrote most of this before your last few comments, sorry, so if anything's out of sequence read it in that light.)

czlee commented 4 years ago

This would likely be a common setting at a tournament with a small number of institutions competing - it would not be feasible to enforce institution conflicts but might enforce history conflicts.

If there are (existent) tournaments that do this, then I'm open to it! The tournaments just have to be not hypothetical.

0zlw commented 4 years ago

Thanks for that full explanation - that all makes sense to me. The tournament was configured off the Australs template which explains why we had intermediate with bubble up/bubble down. My first reaction was to change the conflict avoidance method from one up/one down to off but I can see why that didn't resolve the issue - I've mentally always thought about bubble up/bubble down and one-up/one-down as being interchangeable the same!