Currently this library just contains the code for an STV election following rules similar to that of Scottish STV.
Documentation and stuff doesn't quite exist, and most of the STV working is done in
ElectionRunner.php. References are provided throughout the codebase in comments with explanations on what it's doing with paragraph references to Scottish STV rules.
Scottish STV is used because it is well defined as it is defined in UK legislature.
The primary differences are its inability to look back on previous rounds to brea ties, so will select a random choice (which is the method Scottish STV always suggests in an event where two candidates are tied in all previous rounds). These elements and use of 'random' means that sometimes running an election count twice will produce slightly different results.
Code coverage is pretty good but the
ElectionRunner class could use a little
more unit testing.