Skip to content

AOSSIE-Org/Agora

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build status coverage report

Agora is a library of data structures and algorithms for counting votes in elections.

Currently the following methods are implemented:

  • Approval
  • Baldwin
  • BipartisanSet
  • Borda
  • Contingent
  • Coomb
  • Copeland
  • Dodgson
  • EVACS - an imitation of eVACS, the STV system used for counting votes in Australian Capital Territory. The ACT Electoral Act specifies the STV method used in ACT.
  • EVACSDWD
  • EVACSnoLP
  • Egalitarian - a simple STV counting algorithm.
  • HybridPluralityPreferentialBlockVoting
  • InstantExhaustiveBallot
  • InstantExhaustiveDropOff
  • InstantRunoff2Round
  • Kemeny-Young
  • Majority
  • Maximin
  • Meek
  • MinimaxCondorcet
  • Nanson
  • Oklahoma
  • PAV - Proportional Approval Voting
  • PreferentialBlockVoting
  • RandomBallot
  • RangeVoting
  • RankedPairs
  • SAV - Satisfaction Approval Voting
  • SMC
  • SPAV - Sequential Proportional Approval Voting
  • Schulze
  • Senate
  • Simple - A simple STV counting algorithm.
  • SmithSet
  • UncoveredSet

Remark: When EVACSMethod is run on real data the computation is slow because of ACTFractionLoss

Input Files

Ballots

id1 weight preference_1^1 > ... > preference_1^{N_1}  
id2 weight preference_2^1 > ... > preference_2^{N_2}
...  
idK weight preference_K^1 > ... > preference_K^{N_K}  

Weight has to be a rational number and its initial value is normally equal to 1/1.

Example:

1 1/1 A  
2 1/1 A > B  
3 1/1 B > A > C  
4 1/1 C  

Candidates

candidate1
candidate1
...
candidateN

Example:

A
B
C

Preference Data

Folder "files" contains

  • Preference data of the following elections: ACT Legislative Assembly 2004, ACT Legislative Assembly 2008, ACT Legislative Assembly 2012 - all are formatted for Agora. The originals can be found on the page of the ACT Electoral Commission.

  • Some simple examples of elections (for testing)

Usage Instructions

You must have SBT (version >= 0.13) installed. SBT automatically downloads all compilers and libraries on which Agora depends.

To start SBT, go to Agora's home folder using the terminal and run:

$ sbt

EVACS (an imitation of ACT's eVACS STV system) requires more memory, thus run:

$ sbt -J-Xmx12G -J-Xms12G  

(you may change the values after Xmx and Xms to suit your needs)

Then you can run Agora within SBT's command line. The following command runs the Majority method on preferences given by file 02-example.txt and candidates enumerated in file 02-candidates.txt looking for 1 winner.

run -d files/Examples/ -b 02-example.e -c 02-candidates.txt -m Majority -v 1

The general command to run Agora is as follows:

run -d /directory/ [-b ballots.txt] -c candidates.txt -m method -v num_of_vacancies [-k num_of_candidates] [-t table]

where

  • method is EVACS, Simple, Egalitarian, Majority, Approval, Borda, Kemeny-Young or Nanson

  • candidates.txt is the file containing all candidates. The tally will be printed in the order as the candidates appear in this file.

  • table is either ACT (a simulation of ACT's scrutiny tables) or Concise. Concise is default.

Note: If -b is omitted, all files in -d are analysed.