Approval

class svvamp.Approval(population, **kwargs)[source]

Approval voting.

Inherits functions and optional parameters from superclasses ElectionResult and Election.

Parameters:
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 candidate c iff preferences_ut[v, c] > 0. To modify this behavior, use attributes approval_comparator and approval_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 voter v approves candidates c iff preferences_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 voter v votes for candidates c.

scores

1d array of integers. scores[c] is the number of voters who vote for candidate c.

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.