test: add a test-case with 70 millions of participants

pull/4/head
Dominique Merle 3 years ago
parent 5ab34db580
commit 845ed67a21

@ -10,7 +10,6 @@ import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import net.joshka.junit.json.params.JsonFileSource;
//import net.joshka.junit.json.params.JsonObject;
class MajorityJudgmentDeliberatorTest {

@ -0,0 +1,16 @@
Do add your test cases in the JSON file.
Some of the sample tallies were made using python.
```python
import numpy as np
def randofsum_unbalanced(s, n):
# Where s = sum (e.g. 40 in your case) and n is the output array length (e.g. 4 in your case)
r = np.random.rand(n)
a = np.array(np.round((r/np.sum(r))*s,0),dtype=int)
while np.sum(a) > s:
a[np.random.choice(n)] -= 1
while np.sum(a) < s:
a[np.random.choice(n)] += 1
return a
```

@ -31,6 +31,24 @@
2,
3
]
},
{
"title": "Millions of participants",
"participants": 72327456,
"tallies": [
[5272679, 19797001, 10732688, 9612936, 1379840, 16886281, 8646031],
[16354546, 11690342, 9451800, 14245973, 817593, 12461162, 7306040],
[9849171, 17970690, 14276861, 4606692, 16404594, 6760147, 2459301],
[2645563, 12907474, 1278331, 22843261, 8025412, 8964952, 15662463],
[16293252, 12277630, 38348, 14929905, 11087753, 10634266, 7066302]
],
"ranks": [
3,
4,
5,
1,
2
]
}
]

Loading…
Cancel
Save