Agora is a library of data structures and algorithms for counting votes in elections.
Currently the following methods are implemented:
ApprovalBaldwinBipartisanSetBordaContingentCoombCopelandDodgsonEVACS- 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.EVACSDWDEVACSnoLPEgalitarian- a simple STV counting algorithm.HybridPluralityPreferentialBlockVotingInstantExhaustiveBallotInstantExhaustiveDropOffInstantRunoff2RoundKemeny-YoungMajorityMaximinMeekMinimaxCondorcetNansonOklahomaPAV- Proportional Approval VotingPreferentialBlockVotingRandomBallotRangeVotingRankedPairsSAV- Satisfaction Approval VotingSMCSPAV- Sequential Proportional Approval VotingSchulzeSenateSimple- A simple STV counting algorithm.SmithSetUncoveredSet
Remark: When EVACSMethod is run on real data the computation is slow because of ACTFractionLoss
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 > CC
4 1/1 CC
candidate1
candidate1
...
candidateN
Example:
A
B
CC
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)
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-YoungorNanson -
candidates.txtis the file containing all candidates. The tally will be printed in the order as the candidates appear in this file. -
tableis eitherACT(a simulation of ACT's scrutiny tables) orConcise. Concise is default.
Note: If -b is omitted, all files in -d are analysed.