Utility Methods¶
Sum Utilitarian¶
- pref_voting.utility_methods.sum_utilitarian(uprof, curr_cands=None)[source]¶
Return the winning set of candidates according to sum of the utilities.
- pref_voting.utility_methods.sum_utilitarian_ranking(uprof, curr_cands=None)[source]¶
Rank the alternatives according to the sum of the utilities. :param uprof: A Profile object. :type uprof: Profile :param curr_cands: A list of candidates to restrict the ranking to. If
None
, then the ranking is over the entire domain of the profile. :type curr_cands: list- Returns:
A ranking of the candidates in
curr_cands
according to sum of the utilities.- Return type:
Relative Utilitarian¶
- pref_voting.utility_methods.relative_utilitarian(uprof, curr_cands=None)[source]¶
Return the winning set of candidates according to sum of the normalized utilities.
- pref_voting.utility_methods.relative_utilitarian_ranking(uprof, curr_cands=None)[source]¶
Rank the alternatives according to sum of the normalized utilities.
- Parameters:
uprof (Profile) – A Profile object.
curr_cands (list) – A list of candidates to restrict the ranking to. If
None
, then the ranking is over the entire domain of the profile.
- Returns:
A ranking of the candidates in
curr_cands
according to sum of the normalized utilities.- Return type:
Note
Before restricting to curr_cands, we normalize with respect to all alternatives in the domain.
Maximin¶
- pref_voting.utility_methods.maximin(uprof, curr_cands=None)[source]¶
Return the winning set of candidates according to minimum utility.
Lexicographic Maximin¶
- pref_voting.utility_methods.lexicographic_maximin(uprof, curr_cands=None)[source]¶
Return the winning set of candidates according to lexicographic maximin ranking.
- pref_voting.utility_methods.lexicographic_maximin_ranking(uprof, curr_cands=None)[source]¶
Rank the alternatives according to the lexicographic maximin ranking. The lexicographic maximin ranking is the ranking that ranks alternatives according to the minimum utility, and then breaks ties by ranking alternatives according to the second minimum utility, and so on.
- Parameters:
uprof (Profile) – A Profile object.
curr_cands (list) – A list of candidates to restrict the ranking to. If
None
, then the ranking is over the entire domain of the profile.
- Returns:
A ranking of the candidates in
curr_cands
according to lexicographic maximin ranking.- Return type:
Nash¶
- pref_voting.utility_methods.nash(uprof, sq=None, curr_cands=None)[source]¶
Return the winning set of candidates according to Nash product ranking.
- pref_voting.utility_methods.nash_ranking(uprof, sq=None, curr_cands=None)[source]¶
Rank the alternatives according to the Nash product ranking. Given the status quo
sq
, the Nash product ranking ranks alternatives according to the product of the utilities of the alternatives minus the utility of the status quo.- Parameters:
uprof (Profile) – A Profile object.
sq (Candidate) – The status quo. If
None
, then the status quo is the first candidate in the domain of the profile.curr_cands (list) – A list of candidates to restrict the ranking to. If
None
, then the ranking is over the entire domain of the profile.
- Returns:
A ranking of the candidates in
curr_cands
according to Nash product ranking.- Return type: