[−][src]Module tallystick::borda
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
BaldwinTally | TODO: Stub |
BordaTally | A generic borda tally. |
NansonTally | TODO: Stub |
Enums
Variant | Specifies method used to assign points to ranked candidates. |
Type Definitions
DefaultBaldwinTally | TODO: Stub |
DefaultBordaTally | A borda tally using |
DefaultNansonTally | TODO: Stub |