[−][src]Struct wybr::methods::alternative::Alternative
A builder for the setup of an Tideman alternative count
See the module level documentation for more.
Default configuration can be generated with Alternative::new(&tally)
, where tally
is a VoteTree
object.
Count is triggered by the run()
method, which returns a solitary winner, or an error.
Methods
impl<'a> Alternative<'a>
[src]
pub fn new(tally: &'a VoteTree) -> Self
[src]
Acquire reference to a vote tally and initiate default configuration, which can be altered with other builder methods. The default configuration involved using Smith set and seed equal to 21.
pub fn seed(&mut self, seed: u32) -> &mut Self
[src]
Alters the random seed potentially used by the election algorithm to break ties
pub fn set_type(&mut self, set_type: SetType) -> &mut Self
[src]
Alters set type
pub fn run(&self) -> Result<GenericOutcome<'a>, ElectionError>
[src]
Performs Tideman alternative STV election
Errors
NotEnoughCandidates
, in case there is less candidates then seats or no votes
Auto Trait Implementations
impl<'a> Send for Alternative<'a>
impl<'a> Sync for Alternative<'a>
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,