Skip to content

Commit

Permalink
Condorcet 2.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-boudry committed Sep 6, 2019
1 parent 4b13874 commit edea1a0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CHANGELOG
=========
All notable changes to this project will be documented in this file.

## [v2.0.0] - Unreleased
## [v2.0.0] - 2019-09-07
### Description
Small but many API changes (renaming, rationalization), sometimes on main methods. Very important internal optimizations. Also use a new namespace!

Expand All @@ -23,7 +23,7 @@ Small but many API changes (renaming, rationalization), sometimes on main method
- Removes the slightly twisted method Election::ignoreMaxVote

### Performance
- Adding, change 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.
- 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.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ A PHP library implementing the Condorcet voting system and other methods like th
* **Stable Version: 2.0.x**
* * *PHP Requirement:* PHP 7.1 with MB String and Json common extensions. _(tested up to PHP 7.4)_
* **Old Stable: 1.8.x** _support provided_
* *PHP Requirement:* PHP 7.1 with Ctype, MB_String, Json common extensions. _(tested up to PHP 7.4)_
* *PHP Requirement:* PHP 7.1 with Ctype, MB_String, Json common extensions. _(tested up to PHP 7.3)_
* **Very Old Stable: 1.0.x** _Support requiring some bait._
* *PHP Requirement:* PHP 5.6 with Ctype, MB_String, Json common extensions. _(tested up to PHP 7.1)_

Expand Down Expand Up @@ -207,11 +207,11 @@ _OK: sacrifice to the local tradition of lazy._

// Natural Condorcet Winner
$myWinner = $myElection1->getWinner(); // Return a candidate object
echo 'My winner is ' . $myWinner->getName();
echo 'My winner is ' . $myCondorcetWinner->getName();

// Natural Condorcet Loser
$myLoser = $myElection1->getLoser(); // Return a candidate object
echo 'My loser is ' . $myLoser->getName();
echo 'My loser is ' . $myCondorcetLoser->getName();

// Schulze Ranking
$myResultBySchulze = $myElection1->getResult('Schulze'); // Return a multi-dimensional array, filled with objects Candidate (multi-dimensional if tie on a rank)
Expand Down
4 changes: 2 additions & 2 deletions Tests/ReadmeQuickExampleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public function testReadmeQuickExample() : void
// Get Result

// Natural Condorcet Winner
$myWinner = $myElection1->getWinner(); // Return a candidate object
$myWinner = $myElection1->getCondorcetWinner(); // Return a candidate object
$this->assertEquals('My winner is Candidate 1<br>', 'My winner is ' . $myWinner->getName() . '<br>');

// Natural Condorcet Loser
$myLoser = $myElection1->getLoser(); // Return a candidate object
$myLoser = $myElection1->getCondorcetLoser(); // Return a candidate object
$this->assertEquals('My loser is Candidate 3', 'My loser is ' . $myLoser->getName());

// Schulze Ranking
Expand Down

0 comments on commit edea1a0

Please sign in to comment.