mcshane-fire / bumps

Code for manipulating results for bumps rowing races, generating results charts, etc.
MIT License
2 stars 0 forks source link

Rethink how to withdraw crews #21

Open mcshane-fire opened 11 months ago

mcshane-fire commented 11 months ago

Example as Mays Mens 1976 results, Corpus Christi 5 withdraws from the penultimate division. 6ecb6e1f080b6b68e0c73b230798d1bda9d43717 adds the file, with two potential codings. The first (commented out) uses x to withdraw the crew, the second uses v0 codes to indicate the crew didn't race.

mcshane-fire commented 11 months ago

Separate the data model from the view.

Data model - shouldn't need to enter results before a withdrawing crew that moves them up one. Shouldn't need to enter results from crews jumping over a gap that are different from us the gap wasn't there. Statistics use the data model for results.

View model - can either show all crews below the withdrawing going up one additional place, or leave a gap where the withdrawn crew was. Or pick one or other method depending of some heuristic.

mcshane-fire commented 11 months ago

Per crew position maintain the boolean of whether the crew in that position has withdraw. As you iterate to the next crew (up 1, or up 3, etc) you would need to check each crew record and skip over withdrawn crews.

Even the v/e exact moves would also want to be relative to the actual start order, so adjusted in the same way. That means we need to correctly be able to iterate down as well as up past the withdrawn crew.

The move array may need to be duplicated - one being the number of actual places gained/lost that day, the other being the change in the crew order that day (so a +1 in the first may result in a +2 in the second, if we're skipping over a withdrawn crew). You need to account for this per day, rather than just overall, so that the stats of places gained on a single day is correct.

The back array would be maintained as is, since it's a map into the crew array.

mcshane-fire commented 11 months ago

However example of 1827 mays (March 17), where a crew overbumps past a withdrawing crew. When processing the results for that day you will get to the o3 command before the x, so processing the x would need changing the definition of the crew that overbumped.

One option could change the withdraw command to be required at the start of the day, with a x(num) to withdraw a given crew number in that day, after which you give the results for all the rest of the crews still racing. Or could keep the syntax as it is, but after withdrawing a crew you'll need to spot crews that jumped over this now vacant slot and redo their commands.

mcshane-fire commented 11 months ago

One question on the accuracy of our stats, it's unclear for the 'v0' type results whether in reality the gap was left and so do crews bumping over this crew go up one or two places? I suspect the division raced without that crew and crews below shuffled up, so an e2 result would only get up 1 on the statistics. Maybe need to review the charts with v entries to try and guess what the best way to handle this is.

mcshane-fire commented 10 months ago

With the current results formatting for withdrawing crews and having virtual crews (with the assumption that racing crews are shuffled up to fill the gaps left by crews skipping that day with virtual results), change 0d253edab56e884434bb6cb8d70e53e8ed0260db fixes the blades colouring and statistics to account for the extra places gained/lost each day. This means this issue now just tracks whether I want to re-code the bumps results processing to cope with gaps in the start order caused by withdrawn crews.