Enum tallystick::Quota [−][src]
pub enum Quota<C> { Droop, Hagenbach, Hare, Imperiali, Static(C), }
Expand description
A quota defines how many votes are required to win an election in relation to the total number of votes cast. nightly
Variants
Droop quota. It is defined as:
floor((total-votes / (total-seats + 1)) + 1
In single-winner elections, it’s often known as “fifty percent plus one”. The Droop quota is always an integer, even when using fractional votes.
See wikipedia for more details.
Hagenbach-Bischoff quota.
Also known as the “Newland-Britton quota” or the “exact Droop quota”, it is defined as:
total-votes / (total-seats + 1)
It differs from the Droop quota in that the quota often contains a fraction. In single-winner elections, the first candidate to achieve more than 50% of the vote wins. This system is best used when fractional votes are being used, or in a transferable-vote system where votes are redistributed fractionally.
See wikipedia for more details.
Hare quota.
It is defined as:
total-votes / total-seats
In single-winner elections, it is equal to one hundred percent of the vote. It is generally not recommended and is included for completeness.
See wikipedia for more details.
Imperiali quota.
It is defined as:
total-votes / (total-seats + 2)
It is rarely used and not recommended.
See wikipedia for more details.
Static quota that does not vary with either the total votes nor the total seats.
Useful for oddball custom tallies with custom quotas.
Implementations
Compute the threshold needed to be elected for the given quota.
Note that total-votes should be the number of votes counted in the tally. It should not include invalid votes that were not added the tally. For weighted tallies, it should be the sum of all weights.
Panics
This method will panic if Quota::Hagenbach
is used with an integer (non Real) count type.
Auto Trait Implementations
impl<C> RefUnwindSafe for Quota<C> where
C: RefUnwindSafe,
impl<C> UnwindSafe for Quota<C> where
C: UnwindSafe,