GeneratorProfileUniformFewRankings#
- class svvamp.GeneratorProfileUniformFewRankings(n_v, n_c, n_max_rankings, sort_voters=False)[source]#
Profile generator drawing rankings uniformly in a random subset of all possible rankings.
- Parameters:
Notes
First, a subset of n_max_rankings rankings is drawn uniformly at random from the set of all possible rankings. Then the ranking of each voter is drawn uniformly from this subset. The whole process is performed at each generation of a profile.
This class is especially useful to find examples and counter-examples that are simple to write, visualize and understand.
Examples
>>> generator = GeneratorProfileUniformFewRankings(n_v=10, n_c=3, n_max_rankings=4) >>> profile = generator() >>> profile.preferences_rk.shape (10, 3)
Note: if
n_max_rankingsis at least as large as the total number of rankings, then this generator is equivalent toGeneratorProfileIc.>>> generator = GeneratorProfileUniformFewRankings(n_v=10, n_c=3, n_max_rankings=6) >>> profile = generator() >>> profile.preferences_rk.shape (10, 3)