Module tallystick::borda[][src]

Expand description

The Borda count is a family of election methods in which voters rank candidates in order of preference. nightly

Requires the nightly feature to be enabled

The Borda count determines the winner by giving each candidate, for each ballot, a number of points corresponding to the number of candidates ranked lower. Once all votes have been counted the candidate with the most points is the winner.

Example

   use tallystick::borda::DefaultBordaTally;
   use tallystick::borda::Variant;

   // Election between Alice, Bob, and Carlos with two winners.
   let mut tally = DefaultBordaTally::new(2, Variant::Borda);
   tally.add(vec!["Alice", "Bob", "Carlos"]);
   tally.add(vec!["Bob", "Carlos", "Alice"]);
   tally.add(vec!["Alice", "Bob", "Carlos"]);
   tally.add(vec!["Carlos", "Bob", "Alice"]);
   tally.add(vec!["Alice", "Carlos", "Bob"]);

   let winners = tally.winners().into_unranked();
   println!("The winners are {:?}", winners);

Structs

TODO: Stub

A generic borda tally.

TODO: Stub

Enums

Specifies method used to assign points to ranked candidates.

Type Definitions

TODO: Stub

A borda tally using u64 integers to count votes. DefaultBordaTally is generally preferred over BordaTally, except when using the Variant::Dowdall variant. Since this is an alias, refer to BordaTally for method documentation.

TODO: Stub