StrategyThreshold

class poisson_approval.StrategyThreshold(d, d_weak_order_ballot=None, ratio_optimistic=None, profile=None, voting_rule=None)[source]

A threshold strategy (for a cardinal profile).

For each ranking, there is a threshold and a ratio_optimistic. E.g. assume that for ranking abc, the threshold is 0.4 and the ratio is 0.2. It means that:

  • A voter abc votes for ab if their utility for b is strictly greater than 0.4,

  • A voter abc votes for a if their utility for b is strictly lower than 0.4,

  • Voters abc whose utility for b is equal to 0.4 are split: a ratio 0.2 are optimistic, they vote only for a (they behave as if the pivot ab was very likely); and a ratio 0.8 are pessimistic, they vote for ab (they behave as if the pivot bc was very likely).

For a given ranking, the threshold and/or the ratio may be None, which means that they are not specified for this strategy.

Parameters
  • d (dict) – Cf. examples below for the different types of input syntax.

  • d_weak_order_ballot (dict) – Key: weak order. Value: strategy. A strategy can be a valid ballot, SPLIT or '' if the behavior of these voters is not specified in the strategy. This is useful in two cases only: for “haters” (e.g. 'a~b>c') in Plurality, and for “lovers” (e.g. 'a>b~c') in Anti-Plurality. In all other cases, voters with a weak order have a dominant strategy and they automatically use it. About 'SPLIT': for example, in Plurality, 'a~b>c': SPLIT means that half of voters with weak order abc cast a ballot for a, and the other half for b.

  • ratio_optimistic (Number) – Cf. examples below for the different types of input syntax.

  • profile (Profile, optional) – The “context” in which the strategy is used.

  • voting_rule (str) – The voting rule. Possible values are APPROVAL, PLURALITY and ANTI_PLURALITY. Default: the same voting rule as profile if a profile is specified, APPROVAL otherwise.

Examples

The two following examples illustrate different ways to define the same profile. The first possible type of input syntax is a dict that maps a ranking to a tuple (threshold, ratio_optimistic). It corresponds exactly to the attribute d_ranking_t_threshold_ratio_optimistic:

>>> strategy = StrategyThreshold({'abc': (0.4, 0.2), 'bac': (0.51, 0.2), 'cab': (1, 0.2)})
>>> print(strategy)
<abc: utility-dependent (0.4, 0.2), bac: utility-dependent (0.51, 0.2), cab: c>

The second possible type of input syntax is a dict that maps a ranking to a threshold. All rankings have the same ratio, given by the parameter ratio_optimistic:

>>> strategy = StrategyThreshold({'abc': 0.4, 'bac': 0.51, 'cab': 1}, ratio_optimistic=0.2)
>>> print(strategy)
<abc: utility-dependent (0.4, 0.2), bac: utility-dependent (0.51, 0.2), cab: c>

Some operations on the strategy:

>>> strategy
StrategyThreshold({'abc': (0.4, 0.2), 'bac': (0.51, 0.2), 'cab': (1, 0.2)})
>>> strategy.abc
'utility-dependent'
>>> strategy.a_bc
'a'
>>> strategy.ab_c
'ab'
>>> strategy.d_ranking_threshold['abc']
0.4

It is possible not to specify the ratios of optimistic voters:

>>> strategy = StrategyThreshold({'abc': 0.4, 'bac': 0.51})
>>> strategy
StrategyThreshold({'abc': 0.4, 'bac': 0.51})
>>> print(strategy)
<abc: utility-dependent (0.4), bac: utility-dependent (0.51)>

If this strategy is applied to a profile where a positive share of voters have ranking abc and a utility 0.2 for their middle candidate b, it will raise an error because the ratio of optimistic voters is needed in that case.

property a_bc

Strategy of voters with type a_bc.

Type

str

property a_cb

Strategy of voters with type a_cb.

Type

str

property ab_c

Strategy of voters with type ab_c.

Type

str

property abc

Strategy of voters with ranking abc.

Type

str

property ac_b

Strategy of voters with type ac_b.

Type

str

property acb

Strategy of voters with ranking acb.

Type

str

property b_ac

Strategy of voters with type b_ac.

Type

str

property b_ca

Strategy of voters with type b_ca.

Type

str

property ba_c

Strategy of voters with type ba_c.

Type

str

property bac

Strategy of voters with ranking bac.

Type

str

property bc_a

Strategy of voters with type bc_a.

Type

str

property bca

Strategy of voters with ranking bca.

Type

str

property c_ab

Strategy of voters with type c_ab.

Type

str

property c_ba

Strategy of voters with type c_ba.

Type

str

property ca_b

Strategy of voters with type ca_b.

Type

str

property cab

Strategy of voters with ranking cab.

Type

str

property cb_a

Strategy of voters with type cb_a.

Type

str

property cba

Strategy of voters with ranking cba.

Type

str

property d_ranking_best_response

Defined when a profile is given. Cf. TauVector.d_ranking_best_response.

property d_ranking_t_threshold_ratio_optimistic

Thresholds and ratios of optimistic voters.

Key : ranking, e.g. 'abc'. Value: tuple (threshold, ratio_optimistic).

Type

dict

deepcopy_with_attached_profile(profile)

Deep copy with an attached profile.

Parameters

profile (Profile) – The new attached profile.

Returns

A deep copy of this strategy, with profile attached to it.

Return type

Strategy

property duo_ab

Defined when a profile is given. Cf. TauVector.duo_ab.

property duo_ac

Defined when a profile is given. Cf. TauVector.duo_ac.

property duo_ba

Defined when a profile is given. Cf. TauVector.duo_ba.

property duo_bc

Defined when a profile is given. Cf. TauVector.duo_bc.

property duo_ca

Defined when a profile is given. Cf. TauVector.duo_ca.

property duo_cb

Defined when a profile is given. Cf. TauVector.duo_cb.

property is_equilibrium

Whether this strategy is an equilibrium (in the context of the given profile). Cf. Profile.is_equilibrium().

Type

EquilibriumStatus

property pivot_strict_ab

Defined when a profile is given. Cf. TauVector.pivot_strict_ab.

property pivot_strict_ac

Defined when a profile is given. Cf. TauVector.pivot_strict_ac.

property pivot_strict_ba

Defined when a profile is given. Cf. TauVector.pivot_strict_ba.

property pivot_strict_bc

Defined when a profile is given. Cf. TauVector.pivot_strict_bc.

property pivot_strict_ca

Defined when a profile is given. Cf. TauVector.pivot_strict_ca.

property pivot_strict_cb

Defined when a profile is given. Cf. TauVector.pivot_strict_cb.

property pivot_tij_abc

Defined when a profile is given. Cf. TauVector.pivot_tij_abc.

property pivot_tij_acb

Defined when a profile is given. Cf. TauVector.pivot_tij_acb.

property pivot_tij_bac

Defined when a profile is given. Cf. TauVector.pivot_tij_bac.

property pivot_tij_bca

Defined when a profile is given. Cf. TauVector.pivot_tij_bca.

property pivot_tij_cab

Defined when a profile is given. Cf. TauVector.pivot_tij_cab.

property pivot_tij_cba

Defined when a profile is given. Cf. TauVector.pivot_tij_cba.

property pivot_tjk_abc

Defined when a profile is given. Cf. TauVector.pivot_tjk_abc.

property pivot_tjk_acb

Defined when a profile is given. Cf. TauVector.pivot_tjk_acb.

property pivot_tjk_bac

Defined when a profile is given. Cf. TauVector.pivot_tjk_bac.

property pivot_tjk_bca

Defined when a profile is given. Cf. TauVector.pivot_tjk_bca.

property pivot_tjk_cab

Defined when a profile is given. Cf. TauVector.pivot_tjk_cab.

property pivot_tjk_cba

Defined when a profile is given. Cf. TauVector.pivot_tjk_cba.

property pivot_weak_ab

Defined when a profile is given. Cf. TauVector.pivot_weak_ab.

property pivot_weak_ac

Defined when a profile is given. Cf. TauVector.pivot_weak_ac.

property pivot_weak_ba

Defined when a profile is given. Cf. TauVector.pivot_weak_ba.

property pivot_weak_bc

Defined when a profile is given. Cf. TauVector.pivot_weak_bc.

property pivot_weak_ca

Defined when a profile is given. Cf. TauVector.pivot_weak_ca.

property pivot_weak_cb

Defined when a profile is given. Cf. TauVector.pivot_weak_cb.

print_all_pivots()

Defined when a profile is given. Cf. TauVector.print_all_pivots().

print_weak_pivots()

Defined when a profile is given. Cf. TauVector.print_weak_pivots().

property scores

Defined when a profile is given. Cf. TauVector.scores.

property share_double_votes

Defined when a profile is given. Cf. TauVector.share_double_votes.

property share_sincere

Share of voters that happen to cast a sincere ballot (in the context of the given profile).

Cf. ProfileCardinal.share_sincere(). This is defined only for a ProfileCardinal.

Type

Number

property share_sincere_among_strategic_voters

Share of strategic voters that happen to cast a sincere ballot (in the context of the given profile).

Cf. ProfileCardinal.share_sincere_among_strategic_voters(). This is defined only for a ProfileCardinal.

Type

Number

property share_single_votes

Defined when a profile is given. Cf. TauVector.share_single_votes.

property tau

The tau-vector associated to this strategy (in the context of the given profile). Cf. Profile.tau().

Type

TauVector

property trio

Defined when a profile is given. Cf. TauVector.trio.

property trio_1t_a

Defined when a profile is given. Cf. TauVector.trio_1t_a.

property trio_1t_b

Defined when a profile is given. Cf. TauVector.trio_1t_b.

property trio_1t_c

Defined when a profile is given. Cf. TauVector.trio_1t_c.

property trio_2t_ab

Defined when a profile is given. Cf. TauVector.trio_2t_ab.

property trio_2t_ac

Defined when a profile is given. Cf. TauVector.trio_2t_ac.

property trio_2t_ba

Defined when a profile is given. Cf. TauVector.trio_2t_ba.

property trio_2t_bc

Defined when a profile is given. Cf. TauVector.trio_2t_bc.

property trio_2t_ca

Defined when a profile is given. Cf. TauVector.trio_2t_ca.

property trio_2t_cb

Defined when a profile is given. Cf. TauVector.trio_2t_cb.

property winners

Defined when a profile is given. Cf. TauVector.winners.

property τ

The tau-vector (alternate notation). Cf. Profile.τ().

Type

TauVector