Closed timotree3 closed 5 years ago
You're right. This behavior should be configurable
You're right. This behavior should be configurable
I'm glad you agree.
Regarding configuration I can't think of a use case where someone would prefer the current output (which is Err(ElectionError::VotersNoVotes)
).
It seems like in order to meet user's expectations given how other sources define the algorithm it should instead return a winner (in this example Ok("alice")
).
What do you think?
Hey, check out this branch:
https://github.com/LivingInSyn/rcir/commit/3f433f9d52ffd4f59b8ea38465f6090f4a53d115
Basically, I added a mode where you can operate under a 'complete majority' mode, by which you have to have >= 50% of all of the voters in agreement, or 'remaining majority' mode, where you need >= 50% of the non-empty voters
This doesn't fix the great VotersNoVotes
error name, but I'll try and come up with a fix for that tomorrow
Closed in favor of:
Cool. I'm still not clear what use case people would want to use the CompleteMajority mode. It's good for there to be a RemainingMajority option either way though. :)
Consider this set of ballots:
Let's see what we get by doing an Instant-runoff vote by hand.
Our implementation gives a different result. It counts ballots that don't have any votes left and in this case finds that Alice would need at least a 3/5 majority to win.