Overview¶
We have three types of collective decision procedures:
Voting Method: given edata, outputs a sorted list of candidates, representing tied winners;
Probabilistic Voting Method: given edata, outputs a dictionary whose keys are candidates and whose values are probabilities;
Social Welfare Function: given edata, outputs a Ranking of the candidates.
We further categorize collective decision procedures based on the input from the voters:
Ordinal procedures take as input a Profile, ProfilesWithTies, MajorityGraph, MarginGraph, and/or SupportGraph. These procedures are discussed in the following:
Cardinal procedures take as input a UtilityProfile and/or a GradeProfile. These procedures are discussed in the following:
VotingMethod Class and Decorator¶
- class pref_voting.voting_method.VotingMethod(vm, name=None, properties=None, input_types=None, skip_registration=False)[source]¶
A class to add functionality to voting methods.
- Parameters:
vm (function) – An implementation of a voting method. The function should accept a Profile, ProfileWithTies, MajorityGraph, and/or MarginGraph, and a keyword parameter
curr_cands
to find the winner after restricting tocurr_cands
.name (string) – The Human-readable name of the voting method.
properties (VotingMethodProperties) – The properties of the voting method.
input_types (list) – The types of input that the voting method can accept.
- display(edata, curr_cands=None, cmap=None, **kwargs)[source]¶
Display the winning set of candidates.
ProbVotingMethod Function Class and Decorator¶
- class pref_voting.prob_voting_method.ProbVotingMethod(pvm, name=None)[source]¶
A class to add functionality to probabilistic voting methods
- Parameters:
pvm (function) – An implementation of a probabilistic voting method. The function should accept any type of profile, and a keyword parameter
curr_cands
to find the winner after restricting tocurr_cands
.name (string) – The human-readable name of the social welfare function.
- choose(edata, curr_cands=None, **kwargs)[source]¶
Return a randomly chosen element according to the probability.
SocialWelfareFunction Class and Decorator¶
A class to add functionality to social welfare functions
swf (function) – An implementation of a voting method. The function should accept any type of profile, and a keyword parameter
curr_cands
to find the winner after restricting tocurr_cands
.name (string) – The Human-readable name of the social welfare function.
Display the result of the social welfare function.
Set the name of the social welfare function.
Return a sorted list of the first place candidates.
A decorator used when creating a social welfare function.