1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use crate;
use ;
use Serialize;
/// Manual Preference Model
///
/// The `Manual` preference type represents a special case where preferences are drawn randomly from real-world data instead of being generated through a probabilistic model like Mallows or Plackett-Luce.
///
/// # Preference Selection
///
/// Given a dataset of real-world ballots, a preference ranking `(c_1, c_2, ..., c_n)` is sampled randomly from the dataset. Formally, if the dataset contains `M` unique rankings, the probability of selecting a specific ranking is:
///
/// ```math
/// P(c_1, c_2, ..., c_n) = 1 / M
/// ```
///
/// where:
/// - `M` is the total number of unique rankings in the dataset.
/// - Each ranking is assumed to be equally probable unless additional weighting is applied.
///
/// # Interpretation
///
/// - This method ensures that generated preferences are grounded in empirical data.
/// - Unlike Mallows or Plackett-Luce, `Manual` does not impose a probabilistic structure, making it suitable for scenarios where real-world rankings are preferred.
/// - If the dataset is small, rankings may be repeated frequently in generated samples.