prefvote

PrefVote::Core

SYNOPSIS

use PrefVote::Core;

# count votes from a properly-formatted YAML file
my $vote_obj = PrefVote::Core::file2vote($progname);
$vote_obj->count();

# get results in YAML
print YAML::XS::Dump($vote_obj->result_yaml());

# get results for your own handling
my $results = $vote_obj->results();
... process $results contents ...

DESCRIPTION

PrefVote::Core is the common code base between voting methods supported by PrefVote. It handles data and code in common among the preference voting systems, including input and tallying of ranked choice ballots, indexing of choices/candidates, computing average choice rank (ACR) as tie-breaking data, storage of basic results, and black-box testing infrastructure.

It is important to understand that PrefVote::Core alone is not a valid voting method. For counting any real votes or polls, this must be used as the superclass for a ranked-choice voting method, such as PrefVote::STV, PrefVote::Schulze or PrefVote::RankedPairs. Those methods make quantitative counts, such that a greater number of votes for one choice will make it win over another if all other things are equal. That is a required expectation in any voting system.

PrefVote::Core collects average choice rank (ACR) data to be used for tie-breaking in any of the supported voting methods. PrefVote::Core may be run alone for testing purposes and will use ACR data in that case. However, the reason ACR is not appropriate as a voting method on its own is because it is an average ranking, regardless of the number of votes cast for a particular choice. It only makes sense for tie-breaking, where becomes meaningful if everything else is equal.

ATTRIBUTES

METHODS

FUNCTIONS

SEE ALSO

PrefVote https://github.com/ikluft/prefvote

BUGS AND LIMITATIONS

Please report bugs via GitHub at https://github.com/ikluft/prefvote/issues

Patches and enhancements may be submitted via a pull request at https://github.com/ikluft/prefvote/pulls