def transferVotesFromLosers(self, cLosers):
"Eliminate candidate according to the Cambridge rules."
# Transfer from candidates with fewest votes first
remainingLosers = cLosers[:]
ppp = self.purgatory[:]
for j in range(len(remainingLosers)):
##### desc is thrown away
(loser, desc) = self.breakWeakTie(self.R-1, remainingLosers, "fewest",
"order of candidate elimination")
remainingLosers.remove(loser)
for bi in self.votes[loser]:
c = self.cleanBallots.getTopChoiceFromBallot(bi, ppp)
if c != None:
self.votes[c].append(bi)
# If receiving candidate becomes a winner, then that
# candidate can't receive any more votes.
if len(self.votes[c]) >= self.thresh[self.R-1]:
ppp.remove(c)
self.votes[loser] = []
desc = "Count after eliminating %s and transferring votes. " % \
self.cleanBallots.joinList(cLosers)
return desc
Original issue reported on code.google.com by jeff.oneill on 18 Oct 2009 at 7:54
Original issue reported on code.google.com by
jeff.oneill
on 18 Oct 2009 at 7:54