Skip to content

Releases: julien-boudry/Condorcet

Version 2.2.0

18 May 16:25
Compare
Choose a tag to compare

Description

Include the new vote method "Two-round voting System", and some minors fix and optimizations.

Added

  • Two-round voting system. Useful to compare Condorcet with traditional elections.
  • New Majority_Core class is the parent class for First-Past-The-Post and two-round system. It can easily be extended with variant parameters or code for creating easily many new majority voting methods (number of rounds, number of candidates retained after each round...).

Changed

  • Complete rewrite of First-Past-The-Post code. No user changes.
  • Provides the right acronyms for First-Past-The-Post voting method.

Internal changes

  • Developments dependency upgrades.

Version 2.1.0

29 Dec 21:57
Compare
Choose a tag to compare

Description

Move to PHP 7.4 version. And add a console application for command line usage!

Added

  • New Condorcet Application from the command line. Easy to use for non-technical users. And faster to use for everyone for most use cases.
  • Docker file for building Condorcet image. For very easy access to the command line application.
  • Official compiled PHAR files are now available for each version on the release page.
  • Json input can include vote weight.
  • New method Election::parseVotesWithoutFail allowing to ignore bad vote, and useful for low and constant memory usage.

Changed

  • PHP 7.4 is the new minimal PHP version required.
  • MBSTRING PHP extension is not requiered anymore.
  • Election::allowVoteWeight() renamed to Election::allowsVoteWeight()
  • Vote::getSimpleRanking() allow a new optional parameter $displayWeight.
  • Vote::getWeight() allow a new optional parameter $context and if providing returning ranking in context of an election instead theorical ranking.

Internal changes

  • Use PHP 7.4 new types on properties. For security and performance reasons.

Version 2.0.0

06 Sep 22:18
Compare
Choose a tag to compare

Description

Small but many API changes (renaming, rationalization), sometimes on main methods. Very important internal optimizations. Also use a new namespace!

Added

  • Very significant efforts about the documentation. Still in progress.
  • Add two distincts methods Election::getCondorcetWinner() & Election::getCondorcetLoser(). the result are strictly equivalent to Election::getWinner(null) & Election::getWinner(null) but it's more explicit. And it is consistent with the homonymous methods of the result object.

Changed

  • Use new vendor namespace \CondorcetPHP instead \Condorcet because we don't have the Github Condorcet ID for this last one. The new base namespace is \CondorcetPHP\Condorcet\
  • Adding votes or candidates from Json or string parsing, will not check if all of them are valid. And only if all are valid, then they are registered. Previously, an exception was sent to the first error, but the status remained partially recorded.
  • Many methods have been renamed or divided for greater consistency and intelligibility. Some parameters may have changed or used more strict type.
  • CondorcertException class moves to a new namespace Throwable\CondorcetException. Condorcet can now also throw Trowable\CondorcetInternalError error.
  • Some change on "Schulze Ratio" method computation, can affect the result of some type of election. It's still imperfect due to a case that the theory doesn't take into account. However, very small or very typical elections will have more logical results. The more common Winning & Margin methods are not affected.
  • Many other various fixes.
  • New Condorcet logo.

Removed

  • Removes the slightly twisted method Election::ignoreMaxVote

Performance

  • Adding, changing or removing vote after requesting firsts Result, will prevent recomputing all the pairwise and prefer to update it. Can be a small optimization for most use case, or a very huge performances improvements if you manage a very large number of votes or use an external data handler for storing them.
  • Parse Vote (text or Json) is really faster, save huge memory consumption on big input if you use the if use the multiplication symbol for equal votes. And memory is now predictable, linear and as smart as other input vote methods.
  • Overall, significant savings in memory usage.
  • Many other performance optimizations.

Internal changes

  • Voting Method extending PairwiseStatsBased_Core must use static constant COUNT_TYPE instead of $_countType property.
  • Add many tests.
  • Add benchmarks with phpbench.

Version 1.8.2

16 Feb 16:59
Compare
Choose a tag to compare

Description

Allow development environment for PHP 7.4.

Changed

  • Use PHP UNIT 8.x (compatible up to PHP 7.4) for PHP version >= 7.2.
  • Compatibility with PHP Unit 8.x serie

Version 1.8.1

05 Jan 16:45
Compare
Choose a tag to compare

Description

Tests for PHP 7.3 and prevent PHP >=7.4 deprecations.

Added

  • Tests for PHP 7.3
  • Prevent PHP 7.4 deprecations.

Version 1.8.0

22 Jul 10:08
Compare
Choose a tag to compare

Description

You can add custom constraint to force votes to meet certain criteria.
Constraint are designed as free modules (external class to load into each election). A first module is officially proposed (disabled by default): Preventing votes from including ties.

Added

  • Vote constraints functionality
  • First official vote constraint module: Disallow vote tie on any rank in election context.
  • Tested with PHP 7.3.
  • Always better code!

Version 1.7.0

26 May 09:14
Compare
Choose a tag to compare

Description

Adds for the first time methods unrelated to Condorcet's criteria (Borda, Alternative Voting, FTPT).

Added

  • New voting method: Borda Count
  • New voting method: Dowdall System (Nauru), a Borda Count variant.
  • New voting method: Instant-runoff (also know as Alternative Voting or Preferential Voting)
  • New voting method: First-past-the-post

Changed

  • Result object (iterator and his others methods) is now ordered by key from first rank to last rank. However, no method officially implemented before version 1.7 was affected by this theoretical problem. This never affected the correct rank allocation, but could cause misinterpretation if carelessly repeated in a loop.

Internal changes

  • Code cleanup & test improvements

Version 1.6.0

28 Jan 17:08
Compare
Choose a tag to compare

Description

Publication centred on two axes:
Firstly, the improvement and finishing of the internal structure, often for the purpose of readability of the code and good practices. And an extension of the tests.
The second part concerns the continued improvement of the management of the very large elections.

Added

  • Add \Condorcet\Election::getVotesListGenerator and \Condorcet\DataManager\VotesManager::getVotesListGenerator methods. Same as getVotesList method, but output a PHP generator instead of full array. Useful only for working on vera large election with an external DataHandler.

Changed

  • \Condorcet\Condorcet::format() method move to \Condorcet\CondorcetUtil::format()
  • \Condorcet\CondorcetUtil::format() can no longer optionally produce a var_dump(). You must do it yourself.
  • Remove \Condorcet\Election::getVoteByKey() method
  • Fix \Condorcet\Election cloning issues
  • Simply DataHandlerDriverInterface
  • Optimize \Condorcet\Election::countVotes and \Condorcet\DataManager\VotesManager::countVotes methods performance and memory usage in case of using an external DataHandler.

Internal changes

  • Cut out some classes and functions into smaller sub-groups.
  • New dev tools in new dedicated folder (update documentation, generate Kemeny–Young cache)
  • Documentation generator code move to a new repository
  • Git force Unix style line-ending (This could cause unexpected behavior in some tests related to the export of votes in string output.)
  • Various optimizations & bugfix
  • Test coverage up to 95%
  • Wonderful new files headers

Version 1.5.0

07 Jan 23:23
Compare
Choose a tag to compare

Description

This release focuses on the management of very large elections.
It more rigorously reviews the functioning of the DataHandler, which is an advanced way to manage a very large number of votes, which is more stable, mature and tested.
It adds, as an alternative and as a complement (both can be used in consort) the notion of the weight of a vote. This may be useful for elections in which voters are not equal. Or to emulate a big election (without too many possible combinations!) if you don't need to store the details of each vote at Condorcet level.

Added

  • It is now possible to add a weight (integer >= 1) to each vote. If you enable this mode at the election level (deactivated by default) then the votes will be proportional to their weight when calculating all the algorithms. for example, if the weight is 2, then the vote will count double.
    This is an alternative and complementary to adding multiple votes. Using this mode of operation can save you (for large elections) a high cost in RAM or the configuration / development of a DataHandler, which can be complex. However, if you need to keep the information of each elector at Condorcet level, this functionality will not satisfy you, it is useful if at this level the voting information is useless or if it makes no sense.
  • Using a DataHandler to externalize vote data is now compatible with vote tags.

Internal changes

  • More mature and tested management of external DataHandler. Your custom drivers need to be updated.
  • News tests
  • Minors clean-up, changes & optimisations

Version 1.4.1

21 Dec 00:38
Compare
Choose a tag to compare

Changed

  • Add some aliases for Ranked Pairs