@k98kurz said:
If we're going to put candidates into a tier list, we ought to include an S tier worth >1 point. I am curious about what effect that would have.
Infinite meme potential
Is the code used to run the ABC simulations open source?
Sure, here's Jameson Quinn's vse-sim and the relevant code is:
def makeLexScaleMethod(topRank=10, steepness=1, threshold=0.5, asClass=False):
class LexScale0to(Method):
"""
Lexical scale voting, 0-10.
"""
bias5 = 2.3536762480634343
compLevels = [1,2]
diehardLevels = [1,2, 4]
@classmethod
def candScore(cls,scores):
"""
Takes the list of votes for a candidate;
Applies sigmoid function;
Returns the candidate's score normalized to [0,1].
"""
scores = [1/(1+((score/cls.topRank)**(log(2, cls.threshold))-1)**cls.steepness) if score != 0 else 0 for score in scores]
return mean(scores)
"""
"""
LexScale0to.topRank = topRank
LexScale0to.steepness = steepness
LexScale0to.threshold = threshold
if asClass:
return LexScale0to
return LexScale0to()
class LexScale(makeLexScaleMethod(5, exp(3), 0.5, True)):
"""
Lexical scale voting: approval voting but retains preferences among both approved and disapproved options.
"""
pass
to convert Score to 'Lexical Scale', and then to change STAR-style automatic runoff to sequential pairwise elimination:
def makeABCMethod(topRank=5, steepness=exp(3), threshold=0.5):
"ABC Voting"
LexScale0to = makeLexScaleMethod(topRank, steepness, threshold, True)
class ABC0to(LexScale0to):
stratTargetFor = Method.stratTarget3
diehardLevels = [1,2,3,4]
compLevels = [1,2,3]
@classmethod
def results(cls, ballots, **kwargs):
baseResults = super(ABC0to, cls).results(ballots, **kwargs)
candidateIndices = list(range(len(baseResults)))
remainingCandidates = candidateIndices[:]
while len(remainingCandidates) > 1:
(secondLowest, lowest) = sorted(remainingCandidates, key=lambda i: baseResults[i])[:2]
upset = sum(sign(ballot[lowest] - ballot[secondLowest]) for ballot in ballots)
if upset > 0:
remainingCandidates.remove(secondLowest)
else:
remainingCandidates.remove(lowest)
winner = remainingCandidates[0]
top = sorted(range(len(baseResults)), key=lambda i: baseResults[i])[-1]
if winner != top:
baseResults[winner] = baseResults[top] + 0.01
return baseResults
"""
"""
if topRank==5:
ABC0to.__name__ = "ABC"
else:
ABC0to.__name__ = "ABC" + str(topRank)
return ABC0to
class ABC(makeABCMethod(5)): pass
Any suggestions for improvement or optimization greatly welcome.