Пример #1
0
    def __init__(self, b):
        NoSurplusSTV.__init__(self, b)
        MethodPlugin.__init__(self)

        self.stopCond = ["N"]
        self.batchElimination = "None"
        self.unranked = []
Пример #2
0
    def __init__(self, b):
        WeightedInclusiveSTV.__init__(self, b)
        MethodPlugin.__init__(self)

        self.prec = 5
        self.threshName = ["Droop", "Static", "Whole"]
        self.delayedTransfer = "Off"
        self.batchElimination = "None"
Пример #3
0
 def __init__(self, b):
   # Note: we're deliberate bypassing MeekSTV.__init__ here
   # because we don't want any UI options
   RecursiveSTV.__init__(self, b)
   MethodPlugin.__init__(self)
   self.weakTieBreakMethod = "forward" # per clauses 19, 34 & 40
   self.prec = 9                       # per clause 5
   self.prng_cands = {}
Пример #4
0
    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"
Пример #5
0
    def __init__(self, b):
        WeightedInclusiveSTV.__init__(self, b)
        MethodPlugin.__init__(self)

        self.prec = 4
        self.threshName = ["Droop", "Static", "Whole"]
        self.delayedTransfer = "On"
        self.batchElimination = "Losers"
        self.weakTieBreakMethod = "strong"
Пример #6
0
    def createUIoptions(self, list):
        for option in list:
            if option == "LERoption":
                self.UIoptions.append(("""
label = wx.StaticText(self, -1, "LER option:")
control = wx.Choice(self, -1, choices = ["LERa", "LERb", "LERab"])
control.SetStringSelection("%s")""" % (self.LERoption), "GetStringSelection()",
                                       "LERoption"))
                list.remove(option)
        MethodPlugin.createUIoptions(self, list)
Пример #7
0
    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
Пример #8
0
    def createUIoptions(self, list):
        for option in list:
            if option == "LERoption":
                self.UIoptions.append( ("""
label = wx.StaticText(self, -1, "LER option:")
control = wx.Choice(self, -1, choices = ["LERa", "LERb", "LERab"])
control.SetStringSelection("%s")""" % (self.LERoption),
                                "GetStringSelection()",
                                "LERoption") )
                list.remove(option)
        MethodPlugin.createUIoptions(self,list)
Пример #9
0
    def __init__(self, b):
        NonIterative.__init__(self, b)
        MethodPlugin.__init__(self)

        self.completion = "Schwartz Sequential Dropping"
        self.createGuiOptions(["completionMethod"])
        self.e = None
        self.smithSet = []
        self.SSDinfo = ""
        self.pMat = []
        self.dMat = []
Пример #10
0
    def __init__(self, b):
        OrderDependentSTV.__init__(self, b)
        MethodPlugin.__init__(self)

        self.batchElimination = "Cutoff"
        self.batchCutoff = 50
        self.threshName = ["Droop", "Static", "Whole"]
        self.delayedTransfer = "Off"
        self.saveWinnersBallots = False
        self.outputDir = None
        self.createGuiOptions(["saveWinnersBallots"])
Пример #11
0
    def __init__(self, b):
        WeightedInclusiveSTV.__init__(self, b)
        MethodPlugin.__init__(self)

        self.prec = 5
        self.weakTieBreakMethod = "strong"  # treat all ties as strong
        self.threshName = ["Droop", "Static", "Fractional"]
        self.delayedTransfer = "Off"
        self.batchElimination = "Zero"
        # Election is over when we have enough winners or all candidates
        # have been eliminated.
        self.stopCond = ["Know Winners", "Continuing Empty"]
Пример #12
0
    def __init__(self, b):
        WeightedInclusiveSTV.__init__(self, b)
        MethodPlugin.__init__(self)

        self.prec = 6
        self.threshName = ["Droop", "Static", "Whole"]
        self.delayedTransfer = "Off"
        self.batchElimination = "Zero"
        self.batchCutoff = 0
        self.createGuiOptions([
            "prec", "thresh0", "thresh1", "thresh2", "delayedTransfer",
            "batchElimination", "batchCutoff"
        ])
Пример #13
0
    def createUIoptions(self, list):
        for option in list:
            if option == "thresh0": list.remove(option)
            elif option == "thresh1": list.remove(option)
            elif option == "thresh2": list.remove(option)
            elif option == "countingMethod":
                self.UIoptions.append(
                    ("""
label = wx.StaticText(self, -1, "Counting Method:")
control = wx.Choice(self, -1, choices = ["Meek", "Warren"])
control.SetStringSelection("%s")""" % (self.countingMethod),
                     "GetStringSelection()", "countingMethod"))
                list.remove(option)
        MethodPlugin.createUIoptions(self, list)
Пример #14
0
    def createUIoptions(self, list):
        for option in list:
            if option == "thresh0": list.remove(option)
            elif option == "thresh1": list.remove(option)
            elif option == "thresh2": list.remove(option)
            elif option == "countingMethod":
                self.UIoptions.append( ("""
label = wx.StaticText(self, -1, "Counting Method:")
control = wx.Choice(self, -1, choices = ["Meek", "Warren"])
control.SetStringSelection("%s")""" % (self.countingMethod),
                                "GetStringSelection()",
                                "countingMethod") )
                list.remove(option)
        MethodPlugin.createUIoptions(self,list)
Пример #15
0
 def __init__(self, b):
   Iterative.__init__(self, b)
   MethodPlugin.__init__(self)
   self.threshName = ["Droop", "Dynamic", "Fractional"]
   self.prec = 10
   self.weakTieBreakMethod = "strong"  # treat all ties as strong
   self.optRestart = True              # option: restart after exclusion
   self.stopCond = ["Continuing Empty"]
   self.va = []         # va[r] is number of active ballots at round r
   self.vc = []         # vc[r][c] is candidate c's votes at round r
   # satisfy reporter
   self.exhausted = []
   self.surplus = []
   self.tc = []         # tc[r][c] is candidate c's ballots' contributions at round r
   self.tx = []         # tx[r] is contribution of inactive ballots at round r
   self.thresh = []     # thresh[r] is the winning quota at round r
   self.votes = []      # votes[c] stores the indices of all votes for candidate c.
   self.restart = False
Пример #16
0
  def __init__(self, b):
    RecursiveSTV.__init__(self, b)
    MethodPlugin.__init__(self)

    self.createGuiOptions(["prec", "thresh0", "thresh1", "thresh2"])
Пример #17
0
    def __init__(self, b):
        NoSurplusSTV.__init__(self, b)
        MethodPlugin.__init__(self)

        self.batchElimination = "Zero"
Пример #18
0
    def __init__(self, b):
        NoSurplusSTV.__init__(self, b)
        MethodPlugin.__init__(self)

        self.batchElimination = "Losers"
        self.weakTieBreakMethod = "strong"
Пример #19
0
 def __init__(self, b):
   NonIterative.__init__(self, b)
   MethodPlugin.__init__(self)
Пример #20
0
 def __init__(self, b):
   Iterative.__init__(self, b)
   MethodPlugin.__init__(self)
   self.prec = 0
Пример #21
0
    def __init__(self, b):
        RecursiveQXSTV.__init__(self, b)
        MethodPlugin.__init__(self)

        self.createGuiOptions(["prec"])
Пример #22
0
    def __init__(self, b):
        NonIterative.__init__(self, b)
        MethodPlugin.__init__(self)

        self.ballotCompletion = "Off"
        self.createGuiOptions(["ballotCompletion"])
Пример #23
0
 def __init__(self, b):
     NoSurplusSTV.__init__(self, b)
     MethodPlugin.__init__(self)