https://github.com/snawoot/copeland
Copeland's preferential voting method implementation.
https://github.com/snawoot/copeland
copeland preferential-voting voting voting-application voting-system
Last synced: over 1 year ago
JSON representation
Copeland's preferential voting method implementation.
- Host: GitHub
- URL: https://github.com/snawoot/copeland
- Owner: Snawoot
- License: mit
- Created: 2024-02-06T19:17:20.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-15T18:23:49.000Z (over 2 years ago)
- Last Synced: 2025-01-26T06:11:16.013Z (over 1 year ago)
- Topics: copeland, preferential-voting, voting, voting-application, voting-system
- Language: Go
- Homepage:
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# copeland
Copeland's preferential voting method implementation. Outputs Copeland's score and ranking for each candidate.
## Usage
### Create ballot files
Just create plain text files with list of preferences for each voter. One candidate name per line.
Example:
a1.txt
```
Bob
Charlie
Alice
Donald
```
a2.txt
```
Donald
Alice
Charlie
Bob
```
a3.txt
```
Alice
Charlie
Bob
Donald
```
### Run the program
```
copeland a1.txt a2.txt a3.txt
```
Example output:
```
Registered names:
ALICE
BOB
CHARLIE
DONALD
Scores:
Rank 1:
3 ALICE
Rank 2:
2 CHARLIE
Rank 3:
1 BOB
Rank 4:
0 DONALD
```
Note: candidate which scored against every other candidate (having score *N-1* with default scoring settings, where *N* is number of candidates), also happens to be a Condorcet winner.
## Synopsis
```
$ copeland -h
Usage:
copeland [OPTION]... [BALLOT FILE OR DIRECTORY]...
Process files with preference lists and output Copeland's ranking.
Options:
-names string
filename of list of names in the voting. If not specified names inferred from first ballot
-normalize-case
normalize case (default true)
-score-loss float
score for tie against opponent
-score-tie float
score for tie against opponent (default 0.5)
-score-win float
score for win against opponent (default 1)
-skip-errors
skip ballot errors, but still report them
-version
show program version and exit
```