- class svvamp.GeneratorProfileEuclideanBox(n_v, n_c, box_dimensions, shift=None, sort_voters=False)[source]#
Profile generator using the ‘Euclidean box’ model.
- Parameters:
Notes
Denote
n_dimthe number of elements inbox_dimensions. For each voter and each candidate, a position is independently and uniformly drawn in a rectangular box of dimensionsbox_dimensions[0],… ,box_dimensions[n_dim - 1]. Ifshiftis used, the distribution of positions for candidates is displaced by this vector.Let
d[v, c]denote the Euclidean distance between votervand candidatec. Thenpreferences_ut[v, c] = A - d[v, c], whereAis such that the average utility is 0 over the whole profile.Remark: if
n_dim = 1, then the profile is single-peaked.Examples
>>> generator = GeneratorProfileEuclideanBox(n_v=10, n_c=3, box_dimensions=[1]) >>> profile = generator() >>> profile.preferences_rk.shape (10, 3)