Open jldodds opened 8 years ago
By the way, how are you currently resolving tie-breaks? I think one simple API / approach to use for now would be to accept as input an ordered list of the candidates that would be used to break ties. For example, it would eliminate indeterminism in testing and the need to stop tests for user input, etc.
Currently the spec is completely non-deterministic about this. That is, it specifies who might be a winner of an election, saying nothing about probabilities. We could do the latter, but it would be significantly more work.
The implementation is parametric over a tie breaking function, a function from a list of candidates to a single candidate. For the sake of testing, the tie-break function could certainly be of the sort you mentioned. I believe you have something along these lines specified in your JSON tests
Thanks. How does the SF implementation currently operate (i.e. what tie-breaking function are you currently using)?
The only place this is currently meaningful is in the test harness that @robdockins wrote for the actual election data. You can see his tie break function in this file where the tie break function uses a random trie. This functionality is not exercised in any of our current tests though.
Great, thanks for the info and pointer.
This will allow us to take note of elections where tiebreaks were inconsequential