[][src]Struct wybr::methods::alternative::Alternative

pub struct Alternative<'a> { /* fields omitted */ }

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]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]