[][src]Function sp_phragmen::equalize

pub fn equalize<AccountId>(
    assignments: &mut Vec<StakedAssignment<AccountId>>,
    supports: &mut SupportMap<AccountId>,
    tolerance: ExtendedBalance,
    iterations: usize
) -> usize where
    AccountId: Ord + Clone

Performs equalize post-processing to the output of the election algorithm. This happens in rounds. The number of rounds and the maximum diff-per-round tolerance can be tuned through input parameters.

Returns the number of iterations that were preformed.

  • assignments: exactly the same is the output of phragmen.
  • supports: mutable reference to s SupportMap. This parameter is updated.
  • tolerance: maximum difference that can occur before an early quite happens.
  • iterations: maximum number of iterations that will be processed.