Approval¶
-
class
svvamp.
Approval
(population, **kwargs)[source]¶ Approval voting.
Inherits functions and optional parameters from superclasses
ElectionResult
andElection
.Parameters: - approval_comparator – See attribute
approval_comparator
. - approval_threshold – See attribute
approval_threshold
.
Example: >>> import svvamp >>> pop = svvamp.PopulationSpheroid(V=100, C=5) >>> election = svvamp.Approval(pop, approval_comparator='>', approval_threshold=0)
Each voter may vote for any number of candidates. The candidate with most votes is declared the winner. In case of a tie, the tied candidate with lowest index wins.
Default behavior of sincere voters: sincere voter
v
approves candidatec
iffpreferences_ut
[v, c]
> 0. To modify this behavior, use attributesapproval_comparator
andapproval_threshold
.not_IIA()
: With our assumptions, Approval voting always meets IIA.CM()
,ICM()
,IM()
,TM()
,UM()
: Exact in polynomial time.References:
‘Approval voting’, Steven Brams and Peter Fishburn. In: American Political Science Review 72 (3 1978), pp. 831–847.-
approval_comparator
¶ String. Can be
'>'
(default) or'>='
.When
approval_comparator
is'>'
, sincere voterv
approves candidatesc
iffpreferences_ut
[v, c]
>approval_threshold
.When
approval_comparator
is'>='
, previous relation is modified accordingly.
-
approval_threshold
¶ Number (default 0). Utility above which a sincere voter approves a candidate. See also
approval_comparator
.
-
ballots
¶ 2d array of values in {0, 1}.
ballots[v, c] = 1
iff voterv
votes for candidatesc
.See also
-
scores
¶ 1d array of integers.
scores[c]
is the number of voters who vote for candidatec
.
-
w
¶ Integer (winning candidate).
- Default behavior in superclass
ElectionResult
: - The candidate with highest value in vector
scores
is declared the winner. In case of a tie, the tied candidate with lowest index wins.
- Default behavior in superclass
- approval_comparator – See attribute