referrerpolicy=no-referrer-when-downgrade

Function generate_bags::thresholds

source ·
pub fn thresholds(
    existential_weight: VoteWeight,
    constant_ratio: f64,
    n_bags: usize,
) -> Vec<VoteWeight>
Expand description

Compute the list of bag thresholds.

Returns a list of exactly n_bags elements, except in the case of overflow. The first element is always existential_weight. The last element is always VoteWeight::MAX.

All other elements are computed from the previous according to the formula threshold[k + 1] = (threshold[k] * ratio).max(threshold[k] + 1);