def __init__(self, b): GregorySTV.__init__(self, b) MethodPlugin.__init__(self) self.prec = 2 self.weakTieBreakMethod = "forward" self.threshName = ["Droop", "Static", "Whole"] self.delayedTransfer = "On" self.batchElimination = "Losers"
def allocateRound(self): "Add quota allocation." GregorySTV.allocateRound(self) self.quota.append(0) # These are copied from the previous round. Depending on the situation, # they will be reused or updated in place. if self.R > 0: self.quota[self.R] = self.quota[self.R - 1] self.thresh[self.R] = self.thresh[self.R - 1]
def __init__(self, b): GregorySTV.__init__(self, b) MethodPlugin.__init__(self) self.prec = 2 self.weakTieBreakMethod = "forward" self.threshName = ["ERS97", "Dynamic", "Fractional"] self.delayedTransfer = "On" self.batchElimination = "LosersERS97" self.numStages = 0
def allocateRound(self): "Add quota allocation." GregorySTV.allocateRound(self) self.quota.append(0) # These are copied from the previous round. Depending on the situation, # they will be reused or updated in place. if self.R > 0: self.quota[self.R] = self.quota[self.R-1] self.thresh[self.R] = self.thresh[self.R-1]
def preCount(self): GregorySTV.preCount(self) # Data structures needed only for ERS97 rules. # ERS97 rules contain stages and substages, but each of these is a round. # Example: # R S # --- # 1 1 # 2 2 # 3 # 4 3 # We need to compute all of the rounds but only print the stages. # Round 3 is a substage between stages 2 and 3. Substages occur when # transferring ballots from eliminated candidate and different ballots # have different values. The stage involves transferring all of the # ballots, but each substage involves transferring ballots of a given # value. self.quota = [] self.S = 0 self.stages = [] # Stores rounds for each stage
def postCount(self): GregorySTV.postCount(self) self.numStages = self.S + 1
def postCount(self): GregorySTV.postCount(self) self.numStages = self.S+1