fn compute_vote_change<Rules:PreferenceDistributionRules>(to_candidate: CandidateIndex, from_candidate: CandidateIndex, count: &SingleCount<Rules::Tally>,verbose:bool) -> VoteChange<Rules::Tally> {
    let tally_to_candidate = count.status.tallies.candidate[to_candidate.0].clone();
    let tally_from_candidate = count.status.tallies.candidate[from_candidate.0].clone();

    if verbose { println!("Tally for from candidate {} is {}, for to candidate {} is {}",from_candidate,tally_from_candidate,to_candidate,tally_to_candidate); }
    let vote_difference = tally_from_candidate  - tally_to_candidate;
    let votes_to_change = vote_difference / 2 + Rules::Tally::from(1); // Want diff of 11 to produce 6, a diff of 12 to produce 7.
    return VoteChange {
        vote_value: votes_to_change,
        from: Some(from_candidate),
        to: Some(to_candidate)
    }
}
/// Find a change that takes directly from one candidate and gives directly to another candidate, typically to make to_candidate be eliminated.
Find a change that takes directly from one candidate and gives directly to another candidate, typically to make to_candidate be eliminated.
Find a change that takes directly from one candidate and gives directly to another candidate typically to make to_candidate be eliminated .
fn compute_vote_change<Rules:PreferenceDistributionRules>(to_candidate: CandidateIndex, from_candidate: CandidateIndex, count: &SingleCount<Rules::Tally>,verbose:bool) -> VoteChange<Rules::Tally> {
    let tally_to_candidate = count.status.tallies.candidate[to_candidate.0].clone();
    let tally_from_candidate = count.status.tallies.candidate[from_candidate.0].clone();
    if verbose { println!("Tally for from candidate {} is {}, for to candidate {} is {}",from_candidate,tally_from_candidate,to_candidate,tally_to_candidate); }
    let vote_difference = tally_from_candidate  - tally_to_candidate;
    let votes_to_change = vote_difference / 2 + Rules::Tally::from(1); // Want diff of 11 to produce 6, a diff of 12 to produce 7.
    return VoteChange {
        vote_value: votes_to_change,
        from: Some(from_candidate),
        to: Some(to_candidate)
    }
}
fn compute_vote_change < Rules : PreferenceDistributionRules > ( to_candidate : CandidateIndex , from_candidate : CandidateIndex , count : & SingleCount < Rules :: Tally > , verbose : bool ) -> VoteChange < Rules :: Tally > { let tally_to_candidate = count . status . tallies . candidate [ to_candidate . 0 ] . clone ( ) ; let tally_from_candidate = count . status . tallies . candidate [ from_candidate . 0 ] . clone ( ) ; if verbose { println ! ( " " from_candidate tally_from_candidate to_candidate tally_to_candidate ) ; } let vote_difference = tally_from_candidate - tally_to_candidate ; let votes_to_change = vote_difference / 2 + Rules :: Tally :: from ( 1 ) ; // Want diff of 11 to produce 6, a diff of 12 to produce 7. return VoteChange { vote_value : votes_to_change , from : Some ( from_candidate ) , to : Some ( to_candidate ) } }
Find a change that takes directly from one candidate and gives directly to another candidate, typically to make to_candidate be eliminated.
Find a change that takes directly from one candidate and gives directly to another candidate typically to make to_candidate be eliminated .
to_candidate
CandidateIndex
from_candidate
CandidateIndex
count
&SingleCount<Rules::Tally>
verbose
bool
to_candidate
CandidateIndex
from_candidate
CandidateIndex
count
&SingleCount<Rules::Tally>
verbose
bool