chiark
/
gitweb
/
~ian
/
appendix-a6.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
a4f2fc6
)
compute-scottish-stv: wip adjust stage 1
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 21 Aug 2016 20:12:19 +0000
(21:12 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 21 Aug 2016 20:12:19 +0000
(21:12 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
compute-scottish-stv
patch
|
blob
|
history
diff --git
a/compute-scottish-stv
b/compute-scottish-stv
index 6fde10308b409753d9f877e1df709300d2558fa3..575f10ed4f5275812acc8dcf3493f0f5b3326653 100755
(executable)
--- a/
compute-scottish-stv
+++ b/
compute-scottish-stv
@@
-244,15
+244,13
@@
sub elect_core ($) {
$c->{NonCont} = 'Elected';
}
-$stage = 1;
-
-sortballots @allvotes;
-countballots();
-computequota();
+$stage = 0;
for (;;) {
$stage++;
+ sortballots @allvotes if $stage == 1;
+
my $seats_remain = $seats
- grep { ($_->{NonCont} // '') eq 'Elected' } values %cands;
if (continuing() <= $seats_remain) {
@@
-265,6
+263,8
@@
for (;;) {
countballots();
+ computequota if $stage == 1;
+
my $c = select_best_worst
sub { $_->{Total} >= $quota },
sub { $_ > $quota },