UNPKG

ecclesia

Version:

Framework for political and electoral simulations

23 lines (22 loc) 940 B
import { Scores } from "../tally"; import { type Attribution, type HasNSeats } from "../attribution"; /** * Creates an attribution method in which all the seats go to the candidate with the highest average score. * * The ballots are not required to grade all the candidates. */ export declare function averageScore<Party>({ nSeats }: { nSeats: number; }): Attribution<Party, Scores<Party>> & HasNSeats; /** * Creates an attribution method in which all the seats go to the candidate with the highest median score. * * If there is a tie, the contingency method is called on the candidates that are tied. * The default contingency is to take the maximum average score. * * The ballots are not required to grade all the candidates. */ export declare function medianScore<Party>({ nSeats, contingency }: { nSeats: number; contingency?: Attribution<Party, Scores<Party>>; }): Attribution<Party, Scores<Party>> & HasNSeats;