pub fn phragmms<AccountId: IdentifierT, P: PerThing128>( to_elect: usize, candidates: Vec<AccountId>, voters: Vec<(AccountId, VoteWeight, impl IntoIterator<Item = AccountId>)>, balancing: Option<BalancingConfig> ) -> Result<ElectionResult<AccountId, P>, Error>
Execute the phragmms method.
This can be used interchangeably with
seq-phragmen and offers a similar API, namely:
- The resulting edge weight distribution is normalized (thus, safe to use for submission).
- The accuracy can be configured via the generic type
- The algorithm is a best-effort to elect
to_elect. If less candidates are provided, less winners are returned, without an error.
This can only fail if the normalization fails. This can happen if for any of the resulting
assignment.distribution.map(|p| p.deconstruct()).sum() fails to fit inside
UpperOf<P>. A user of this crate may statically assert that this can never happen and safely
expect this to return