Skip to content

A Julia package for simulating and analyzing rank choice voting systems.

License

Notifications You must be signed in to change notification settings

itsdfish/RankChoiceVoting.jl

Repository files navigation

RankChoiceVoting.jl

CI

This package provides a framework for simulating and evaluating rank choice voting systems. See the documentation for details.

Quick Example

The code block below provides an example in which the instant runoff voting system violates the monotonicity criterion. First, load the package and generate some rank choice votes.

using RankChoiceVoting 
ranks = [[:a,:b,:c],[:b,:c,:a],[:b,:a,:c],[:c,:a,:b]]
counts = [37,22,12,29] 
rankings = Ranks(counts, ranks)
counts      ranks
37          [:a, :b, :c]
22          [:b, :c, :a]
12          [:b, :a, :c]
29          [:c, :a, :b]

Next, create an object for an instant runoff system and the monotonicity criterion.

system = InstantRunOff()
criterion = Monotonicity()

Now we can use the function satisfies to determine whether the instant runoff system violates monotonicty in the provided rank choice votes.

satisfies(system, criterion, rankings)
false

See the documentation for more information and examples.