diff --git a/README.md b/README.md index 685caec..610bf1a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Release](https://img.shields.io/github/v/release/MieuxVoter/majority-judgment-library-java?sort=semver)](https://github.com/MieuxVoter/majority-judgment-library-java/releases) [![Join the Discord chat at https://discord.gg/rAAQG9S](https://img.shields.io/discord/705322981102190593.svg)](https://discord.gg/rAAQG9S) -Test-driven java library to help deliberate using Majority Judgment. +Test-driven java library to help deliberate using [Majority Judgment](https://mieuxvoter.fr/index.php/decouvrir/?lang=en). The goal is to be **scalable**, **reliable**, fast and extensible. We therefore use a _score-based algorithm_ and _no floating-point arithmetic_ whatsoever. diff --git a/src/test/java/fr/mieuxvoter/mj/MajorityJudgmentDeliberatorTest.java b/src/test/java/fr/mieuxvoter/mj/MajorityJudgmentDeliberatorTest.java index 046856a..7a1ed55 100644 --- a/src/test/java/fr/mieuxvoter/mj/MajorityJudgmentDeliberatorTest.java +++ b/src/test/java/fr/mieuxvoter/mj/MajorityJudgmentDeliberatorTest.java @@ -110,6 +110,25 @@ class MajorityJudgmentDeliberatorTest { assertEquals(1, result.getProposalResults()[1].getRank()); } + @Test + public void testWithThousandsOfProposals() { + int amountOfProposals = 1337; + DeliberatorInterface mj = new MajorityJudgmentDeliberator(); + ProposalTallyInterface[] tallies = new ProposalTallyInterface[amountOfProposals]; + for (int i = 0 ; i < amountOfProposals ; i++) { + tallies[i] = new ProposalTally(new Integer[]{ 0, 2, 1 }); + } + TallyInterface tally = new TallyWithDefaultGrade(tallies, 3, 0); + + ResultInterface result = mj.deliberate(tally); + + assertNotNull(result); + assertEquals(amountOfProposals, result.getProposalResults().length); + for (int i = 0 ; i < amountOfProposals ; i++) { + assertEquals(1, result.getProposalResults()[i].getRank()); + } + } + // @Test // public void runBenchmarks() throws Exception { // Options options = new OptionsBuilder()