RangeVotingAverage

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

Range Voting with Average.

Inherits functions and optional parameters from superclasses ElectionResult and Election.

Parameters:
Example:
>>> import svvamp
>>> pop = svvamp.PopulationSpheroid(V=100, C=5)
>>> election = svvamp.RangeVotingAverage(pop, min_grade=0, max_grade=1, step_grade=0, rescale_grades=True)

Each voter attributes a grade to each candidate. By default, authorized grades are all numbers in the interval [min_grade, max_grade]. To use a discrete set of notes, modify attribute step_grade.

The candidate with highest average grade wins. In case of a tie, the tied candidate with lowest index is declared the winner.

Default behavior of sincere voters: voter v applies an affine transformation to her utilities preferences_ut[v, :] to get her grades, such that her least-liked candidate receives min_grade and her most-liked candidate receives max_grade. To modify this behavior, use attribute rescale_grades. For more details about the behavior of sincere voters, see ballots.

not_IIA():

CM(), ICM(), IM(), TM(), UM(): Exact in polynomial time.

ballots

2d array of integers. ballots[v, c] is the grade attributed by voter v to candidate c (when voting sincerely). The following process is used.

  1. Convert utilities into grades in interval [min_grade, max_grade].

  2. If step_grades > 0 (discrete set of grades), round each grade to the closest authorized grade.

max_grade

Number. Maximal grade allowed.

min_grade

Number. Minimal grade allowed.

rescale_grades

Boolean. Whether sincere voters rescale their utilities to produce grades.

If rescale_grades = True, then each sincere voter v applies an affine transformation to send her utilities into the interval [min_grade, max_grade].

If rescale_grades = False, then each sincere voter v clips her utilities into the interval [min_grade, max_grade].

See ballots for more details.

scores

1d array of integers. scores[c] is the average grade of candidate c.

step_grade

Number. Interval between two consecutive allowed grades.

If step_grade = 0, all grades in the interval [min_grade, max_grade] are allowed (‘continuous’ set of grades).

If step_grade > 0, authorized grades are the multiples of step_grade lying in the interval [min_grade, max_grade]. In addition, the grades min_grade and max_grade are always authorized, even if they are not multiples of step_grade.

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.