votes
    Preparing search index...

    Class Election<C>

    Chains pre-built rankers: the first provides the primary ranking, each subsequent one breaks remaining ties.

    new Election({
    rankers: [
    new InstantRunoff({ ballots, candidates, tieBreakers: [tb(Copeland)] }),
    new Schulze(matrixFromBallots(ballots, candidates)),
    new RandomCandidates({ candidates, rng: myRng }),
    ],
    })

    Type Parameters

    • C extends string

    Implements

    Index
    • Ranking built by repeated wins: run the full election, record the winning tier, then re-run the whole election restricted to the remaining candidates for the next place, and so on. See Method#iteratedRanking.

      Returns C[][]

    • A new Election with every ranker restricted to a subset of candidates. Requires every ranker to support restrict() (all built-in methods do).

      Parameters

      • candidates: C[]

      Returns Election<C>

    • Returns ElectionResult<C>