From: Don Armstrong Date: Sun, 12 Apr 2015 18:37:21 +0000 (-0700) Subject: support specifying quorum; keep default at 2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=931f6e0e582fe9438436c84f415246188c88c2f6;p=debian-ctte.git support specifying quorum; keep default at 2 --- diff --git a/scripts/pocket-devotee b/scripts/pocket-devotee index d176de8..9107a0b 100755 --- a/scripts/pocket-devotee +++ b/scripts/pocket-devotee @@ -99,6 +99,7 @@ sub main { GetOptions(\%options, 'option=s@', 'default_option|default-option!', + 'quorum=i', ); if (not exists $options{option} or not ref($options{option}) or @{$options{option}} < 2 @@ -116,6 +117,7 @@ sub main { } winner(options=>\@options, default_option => exists $options{default_option} ? $options{default_option} : 1, + quorum => exists $options{quorum} ? $options{quorum} : 2, ); } @@ -163,7 +165,7 @@ sub winner { } # The constitution defines the maximum value of K to be 5 - my $K = 2; # Math::BigFloat->new($params{quorum}); + my $K = $params{quorum}; # 1. Given two options A and B, V(A,B) is the number of voters who # prefer option A over option B.