From 290ddad6343aad77c70190aff780e8509210c7d5 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Sun, 20 Jun 2021 01:51:34 +1000 Subject: [PATCH] Show updated keep value after exclusion when --meek-nz-exclusion --- src/stv/meek.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/stv/meek.rs b/src/stv/meek.rs index 5453d43..03e532e 100644 --- a/src/stv/meek.rs +++ b/src/stv/meek.rs @@ -368,6 +368,15 @@ where }) .collect(); recompute_keep_values(state, opts, &has_surplus); + + let kv_str = state.election.candidates.iter() + .map(|c| (c, state.candidates.get(c).unwrap())) + .filter(|(_, cc)| cc.state == CandidateState::Elected) + .sorted_unstable_by(|a, b| a.1.order_elected.cmp(&b.1.order_elected)) + .map(|(c, cc)| format!("{} ({:.dps2$})", c.name, cc.keep_value.as_ref().unwrap(), dps2=max(opts.pp_decimals, 2))) + .join(", "); + + state.logger.log_literal(format!("Keep values of elected candidates are: {}.", kv_str)); } // Used to give bulk excluded candidate the same order_elected