UNPKG

ecclesia

Version:

Framework for political and electoral simulations

21 lines (20 loc) 707 B
import { type ReadonlyCounter } from "@gouvernathor/python/collections"; import { type Simple } from "../tally"; export interface DisproportionMetric<Party> { (p0: { votes: Simple<Party>; seats: ReadonlyCounter<Party, number>; }): number; } /** * Returns the mean value (across all candidates) of the absolute difference * between the theoretical, (f)ra(c)tional number of seats and the allocated number of seats. * The bigger, the less proportional. * * Compared to a sum or mean of absolute differences of percentage, * this */ export declare function defaultMetric<Party>({ votes, seats }: { votes: Simple<Party>; seats: ReadonlyCounter<Party, number>; }): number;