ecclesia
Version:
Framework for political and electoral simulations
18 lines (17 loc) • 765 B
TypeScript
import { type RandomObjParam } from "../../utils";
import { type Simple } from "../tally";
import { type Attribution, type HasNSeats } from "../attribution";
/**
* Randomized attribution.
* Everyone votes, then one ballot is selected at random.
* (One ballot per seat to fill, and assuming there's
* enough ballots that the picking is with replacement.)
*
* The randomization is based on the given parameters. If a RNG object
* is passed, it is used without reseeding across all calls of the attribution.
* If a seed is passed, the random object is reseeded
* at each call of the attribution.
*/
export declare function randomize<Party>({ nSeats, ...randomParam }: {
nSeats: number;
} & RandomObjParam): Attribution<Party, Simple<Party>> & HasNSeats;