From ce8b252453a1e2b4badb1f8cd293ccf2e91f4ed1 Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Wed, 23 Jun 2021 00:52:25 +1000 Subject: [PATCH] Implement --no-early-bulk-elect --- docs/options.md | 8 ++++++++ html/index.html | 2 +- html/index.js | 19 ++++++++++--------- src/main.rs | 5 +++++ src/stv/mod.rs | 14 +++++++++++++- src/stv/wasm.rs | 2 ++ tests/aec.rs | 1 + tests/csm.rs | 1 + tests/ers97.rs | 1 + tests/meek.rs | 3 +++ tests/prsa.rs | 1 + tests/scotland.rs | 2 ++ 12 files changed, 48 insertions(+), 11 deletions(-) diff --git a/docs/options.md b/docs/options.md index 3e41fd3..3f46ce9 100644 --- a/docs/options.md +++ b/docs/options.md @@ -137,6 +137,14 @@ When ballots are normalised, a set of preferences with weight *n* > 1 is instead ## Count optimisations +## Early bulk election (--no-early-bulk-elect) + +When early bulk election is enabled (default), all remaining candidates are declared elected in a single stage as soon as the number of not-excluded candidates exactly equals the number of vacancies to fill. Further surplus distributions are not performed, and outstanding exclusions, if any, are not completed. This is typical of most STV rules. + +When early bulk election is disabled, surpluses continue to be distributed, and outstanding exclusions continue to be completed, even once the number of not-excluded candidates exactly equals the number of vacancies to fill. Bulk election is performed only once there are no more surpluses to distribute, and no exclusions to complete. + +In either case, candidates are declared elected in descending order of votes. This ensures that only one candidate is ever elected at a time and the order of election is well-defined, which is required e.g. for some affirmative action rules. + ### Bulk exclusion (--bulk-exclude) When bulk exclusion is disabled (default), only one candidate is ever excluded per stage. diff --git a/html/index.html b/html/index.html index 6825018..50ab513 100644 --- a/html/index.html +++ b/html/index.html @@ -179,7 +179,7 @@ Count optimisations: