pub fn parcel_out_votes_with_given_transfer_value(&mut self,transfer_value:TransferValue,distributed:DistributedVotes<'a>,when_tv_created:Option<CountIndex>,original_worth:Rules::Tally,distribute_exhausted_votes:bool,is_exclusion:bool,extra_multiple_for_exhausted:Option<&BigRational>) {
        let mut tally_distributed = Rules::Tally::zero();
        for (candidate_index,candidate_ballots) in distributed.by_candidate.into_iter().enumerate() {
            if candidate_ballots.num_ballots.0>0 {
                let worth:Rules::Tally = Rules::use_transfer_value(&transfer_value,candidate_ballots.num_ballots);
                self.tallys[candidate_index]+=worth.clone();
                tally_distributed +=worth.clone();
                self.papers[candidate_index].add(&candidate_ballots, transfer_value.clone(), self.current_count, when_tv_created, worth);
            }
        }
        if distributed.exhausted.0>0 {
            if distribute_exhausted_votes {
                let exhausted_tv = if let Some(em) = extra_multiple_for_exhausted { TransferValue(transfer_value.0*em) } else { transfer_value };
                let worth:Rules::Tally = Rules::use_transfer_value(&exhausted_tv,distributed.exhausted);
                let worth:Rules::Tally = Rules::munge_exhausted_votes(worth,is_exclusion); // support emulation of weird bugs.
                self.tally_exhausted+=worth.clone();
                tally_distributed +=worth.clone();
            }
            // always distribute the papers.
            self.exhausted+=distributed.exhausted;
            self.exhausted_atl+=distributed.exhausted_atl;
        }
        self.tally_lost_to_rounding+=original_worth;
        self.tally_lost_to_rounding-= tally_distributed;
    }
/// Parcel out votes by next continuing candidate with a given transfer value.
Parcel out votes by next continuing candidate with a given transfer value.
Parcel out votes by next continuing candidate with a given transfer value .
pub fn parcel_out_votes_with_given_transfer_value(&mut self,transfer_value:TransferValue,distributed:DistributedVotes<'a>,when_tv_created:Option<CountIndex>,original_worth:Rules::Tally,distribute_exhausted_votes:bool,is_exclusion:bool,extra_multiple_for_exhausted:Option<&BigRational>) {
        let mut tally_distributed = Rules::Tally::zero();
        for (candidate_index,candidate_ballots) in distributed.by_candidate.into_iter().enumerate() {
            if candidate_ballots.num_ballots.0>0 {
                let worth:Rules::Tally = Rules::use_transfer_value(&transfer_value,candidate_ballots.num_ballots);
                self.tallys[candidate_index]+=worth.clone();
                tally_distributed +=worth.clone();
                self.papers[candidate_index].add(&candidate_ballots, transfer_value.clone(), self.current_count, when_tv_created, worth);
            }
        }
        if distributed.exhausted.0>0 {
            if distribute_exhausted_votes {
                let exhausted_tv = if let Some(em) = extra_multiple_for_exhausted { TransferValue(transfer_value.0*em) } else { transfer_value };
                let worth:Rules::Tally = Rules::use_transfer_value(&exhausted_tv,distributed.exhausted);
                let worth:Rules::Tally = Rules::munge_exhausted_votes(worth,is_exclusion); // support emulation of weird bugs.
                self.tally_exhausted+=worth.clone();
                tally_distributed +=worth.clone();
            }
            // always distribute the papers.
            self.exhausted+=distributed.exhausted;
            self.exhausted_atl+=distributed.exhausted_atl;
        }
        self.tally_lost_to_rounding+=original_worth;
        self.tally_lost_to_rounding-= tally_distributed;
    }
pub fn parcel_out_votes_with_given_transfer_value ( & mut self , transfer_value : TransferValue , distributed : DistributedVotes < ' a > , when_tv_created : Option < CountIndex > , original_worth : Rules :: Tally , distribute_exhausted_votes : bool , is_exclusion : bool , extra_multiple_for_exhausted : Option < & BigRational > ) { let mut tally_distributed = Rules :: Tally :: zero ( ) ; for ( candidate_index , candidate_ballots ) in distributed . by_candidate . into_iter ( ) . enumerate ( ) { if candidate_ballots . num_ballots . 0 > 0 { let worth : Rules :: Tally = Rules :: use_transfer_value ( & transfer_value , candidate_ballots . num_ballots ) ; self . tallys [ candidate_index ] += worth . clone ( ) ; tally_distributed += worth . clone ( ) ; self . papers [ candidate_index ] . add ( & candidate_ballots , transfer_value . clone ( ) , self . current_count , when_tv_created , worth ) ; } } if distributed . exhausted . 0 > 0 { if distribute_exhausted_votes { let exhausted_tv = if let Some ( em ) = extra_multiple_for_exhausted { TransferValue ( transfer_value . 0 * em ) } else { transfer_value } ; let worth : Rules :: Tally = Rules :: use_transfer_value ( & exhausted_tv , distributed . exhausted ) ; let worth : Rules :: Tally = Rules :: munge_exhausted_votes ( worth , is_exclusion ) ; // support emulation of weird bugs. self . tally_exhausted += worth . clone ( ) ; tally_distributed += worth . clone ( ) ; } // always distribute the papers. self . exhausted += distributed . exhausted ; self . exhausted_atl += distributed . exhausted_atl ; } self . tally_lost_to_rounding += original_worth ; self . tally_lost_to_rounding -= tally_distributed ; }
Parcel out votes by next continuing candidate with a given transfer value.
Parcel out votes by next continuing candidate with a given transfer value .
&mut self
transfer_value
TransferValue
distributed
DistributedVotes<'a>
when_tv_created
Option<CountIndex>
original_worth
Rules::Tally
distribute_exhausted_votes
bool
is_exclusion
bool
extra_multiple_for_exhausted
Option<&BigRational>
&mut self
transfer_value
TransferValue
distributed
DistributedVotes<'a>
when_tv_created
Option<CountIndex>
original_worth
Rules::Tally
distribute_exhausted_votes
bool
is_exclusion
bool
extra_multiple_for_exhausted
Option<&BigRational>