Fix error/bug in unweighted inclusive Gregory implementation

This commit is contained in:
RunasSudo 2020-12-27 18:55:29 +11:00
parent d1528ee987
commit 81dbadb8ae
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A

View File

@ -463,10 +463,11 @@ class BaseUIGSTVCounter(BaseSTVCounter):
Basic unweighted inclusive Gregory STV counter Basic unweighted inclusive Gregory STV counter
""" """
def __init__(self, *args, **kwargs): def __init__(self, *args):
BaseSTVCounter.__init__(self, *args, **kwargs) BaseSTVCounter.__init__(self, *args)
# Need to use Rational for ballot value internally, as Num may be set to integers only # Need to use Rational for ballot value internally, as Num may be set to integers only
self.cls_ballot_value = Rational #self.cls_ballot_value = Rational
self.cls_ballot_value = lambda x: x.to_rational()
def do_surplus(self, candidate_surplus, count_card, surplus): def do_surplus(self, candidate_surplus, count_card, surplus):
# FIXME: Is it okay to use native int's here? # FIXME: Is it okay to use native int's here?