Closed DominikPeters closed 1 year ago
Temporary fix: all relevant methods check whether the profile has unit weights (and throw a NotImplementedError otherwise)
I have added convert_to_weighted
and convert_to_unit_weights
methods for Profile
.
Implemented by PR #68
The current versions of the properties are not right in cases where voters have weights (where for priceability, a voter's initial budget should be proportional to her weight, and for EJR and the like, the coalition needs to have total weight at least ell * total_weight/k). The algorithms should be generalized.
For writing tests, it would be useful to give the
Profile
class a method named something likeconvert_to_weighted()
, which would combine several voters with the same approval set into a single voter with an appropriate weight. Then in tests, we can test for various instances thatcheck_property(profile, committee) == check_property(profile.convert_to_weighted(), committee)
. (Alternatively one could keep things immutable and have a function that returns a copy of the profile with voters collapsed.)