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

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

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

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

Imperiali quota.

It is defined as:

total-votes / (total-seats + 2)

It is rarely used and not recommended.

See wikipedia for more details.

Static(C)

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.