Function select_authorities

Source
pub fn select_authorities<T: Clone>(
    weighted_candidates: Vec<(T, Weight)>,
    seed: <ChaCha20Rng as SeedableRng>::Seed,
    size: u16,
) -> Option<Vec<T>>
Expand description

Simple random weighted selection

When selecting out of n candidates with weights w_1, w_2, …, w_n, independently assigns each committee seat to the k-th candidate with probability w_k / (w_1 + w_2 + ... + w_n).