Skip to content

Commit

Permalink
fix incorrect transfers
Browse files Browse the repository at this point in the history
  • Loading branch information
artoonie committed Sep 17, 2024
1 parent 4fd6b96 commit bd33aae
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 11 deletions.
5 changes: 3 additions & 2 deletions src/main/java/network/brightspots/rcv/RoundTally.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,15 @@ public List<String> getSortedCandidatesByTally() {

private void countBallots() {
inactiveBallotSum = BigDecimal.ZERO;
activeBallotSum = BigDecimal.ZERO;
ballotStatusTallies.forEach(
(statusForRound, tally) -> {
if (statusForRound.isInactiveBallot()) {
inactiveBallotSum = inactiveBallotSum.add(tally);
} else {
activeBallotSum = activeBallotSum.add(tally);
}
});

activeBallotSum = ballotStatusTallies.get(StatusForRound.ACTIVE);
}

private void ensureFinalized() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ MARY LYNN MCPHERSON,3373,5.67%,5,3378,5.68%,101,3479,5.85%,0.0000,3479.0000,5.85
ISHMAEL ISRAEL,3305,5.55%,5,3310,5.56%,64,3374,5.67%,0.0000,3374.0000,5.67%,-3374.0000,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0
CASPER HILL,1280,2.15%,4,1284,2.15%,-1284,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0
Undeclared Write-ins,342,0.57%,-342,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0
Active Ballots,59463,,,59174,,,58876,,,58876.0000,,,57861.0000,,,56780.0000,,,54875.0000,,,51478.0000,,,48418.0000,,,42155.0000,,,41977.0000,,
Active Ballots,59463,,,59174,,,58876,,,58876.0000,,,57861.0000,,,56780.0000,,,54875.0000,,,51478.0000,,,48418.0000,,,42155.0000,,,42154.5192,,
Current Round Threshold,14866,,,14866,,,14866,,,14866,,,14866,,,14866,,,14866,,,14866,,,14866,,,14866,,,14866,,
Inactive Ballots by Overvotes,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0
Inactive Ballots by Skipped Rankings,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ MARY LYNN MCPHERSON,3373,5.67%,5,3378,5.68%,101,3479,5.85%,202,3681,6.19%,-3681,
ISHMAEL ISRAEL,3305,5.55%,5,3310,5.56%,64,3374,5.67%,-3374,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0
CASPER HILL,1280,2.15%,4,1284,2.15%,-1284,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0
Undeclared Write-ins,342,0.57%,-342,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0
Active Ballots,59463,,,59174,,,58876,,,57926,,,56924,,,55274,,,52027,,,49968,,,47268,,,45439.0000,,
Active Ballots,59463,,,59174,,,58876,,,57926,,,56924,,,55274,,,52027,,,49968,,,47268,,,47266.2600,,
Current Round Threshold,19821,,,19821,,,19821,,,19821,,,19821,,,19821,,,19821,,,19821,,,19821,,,19821,,
Inactive Ballots by Overvotes,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0
Inactive Ballots by Skipped Rankings,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ E,5,20.83%,0,5,20.83%,0.0000,5.0000,20.83%,0.0000,5.0000,20.83%,-5.0000,0,0.0%,0
B,4,16.66%,0,4,16.66%,0,4,16.66%,2.0000,6.0000,25.0%,2.0000,8.0000,33.33%,-1.6000,6.4000,26.66%,0
F,3,12.5%,0,3,12.5%,0.0000,3.0000,12.5%,-3.0000,0,0.0%,0,0,0.0%,0,0,0.0%,0
D,2,8.33%,-2,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0
Active Ballots,24,,,23,,,23.0000,,,23.0000,,,23.0000,,,19.6000,,
Active Ballots,24,,,23,,,23.0000,,,23.0000,,,23.0000,,,23.0000,,
Inactive Ballots by Overvotes,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0
Inactive Ballots by Skipped Rankings,1,,1,2,,0,2,,0,2,,0.0000,2.0000,,0.0000,2.0000,,0
Inactive Ballots by Exhausted Choices,0,,0,0,,0,0,,0,0,,0.0000,0.0000,,0.0000,0.0000,,0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ E,1,20.0%,0,1,20.0%,0.0000,1.0000,20.0%,0.0000,1.0000,20.0%,-1.0000,0,0.0%,0,0,0
B,1,20.0%,0,1,20.0%,0,1,20.0%,0,1,20.0%,1,2,40.0%,-0.4000,1.6000,32.0%,0
F,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0
D,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0
Active Ballots,5,,,5,,,5.0000,,,5.0000,,,5.0000,,,4.4000,,
Active Ballots,5,,,5,,,5.0000,,,5.0000,,,5.0000,,,5.0000,,
Inactive Ballots by Overvotes,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0
Inactive Ballots by Skipped Rankings,0,,0,0,,0,0,,0,0,,0.0000,0.0000,,0.0000,0.0000,,0
Inactive Ballots by Exhausted Choices,0,,0,0,,0,0,,0,0,,0.0000,0.0000,,0.0000,0.0000,,0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ E,6,20.68%,0,6,20.68%,0.0000,6.0000,20.68%,0.0000,6.0000,20.68%,-6.0000,0,0.0%,0
B,5,17.24%,0,5,17.24%,0,5,17.24%,2.0000,7.0000,24.13%,3.0000,10.0000,34.48%,-2.0000,8.0000,27.58%,0
F,3,10.34%,0,3,10.34%,0.0000,3.0000,10.34%,-3.0000,0,0.0%,0,0,0.0%,0,0,0.0%,0
D,2,6.89%,-2,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0
Active Ballots,29,,,28,,,28.0000,,,28.0000,,,28.0000,,,24.0000,,
Active Ballots,29,,,28,,,28.0000,,,28.0000,,,28.0000,,,28.0000,,
Current Round Threshold,8,,,8,,,8,,,8,,,8,,,8,,
Inactive Ballots by Overvotes,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0
Inactive Ballots by Skipped Rankings,1,,1,2,,0,2,,0,2,,0.0000,2.0000,,0.0000,2.0000,,0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A,3,33.33%,-0.7499,2.2501,25.0%,0.0000,2.2501,25.0%,0.0000,2.2501,25.0%,0
B,3,33.33%,0.7497,3.7497,41.66%,-1.4996,2.2501,25.0%,0.0000,2.2501,25.0%,0
C,3,33.33%,0,3,33.33%,1.4994,4.4994,49.99%,-2.2493,2.2501,25.0%,0
D,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0
Active Ballots,9,,,8.9998,,,8.9996,,,6.7503,,
Active Ballots,9,,,8.9998,,,8.9996,,,8.9994,,
Current Round Threshold,2.2501,,,2.2501,,,2.2501,,,2.2501,,
Inactive Ballots by Overvotes,0,,0,0,,0,0,,0,0,,0
Inactive Ballots by Skipped Rankings,0,,0,0,,0,0,,0,0,,0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@
"totalNumBallots" : "9",
"undervotes" : 0
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Candidate E Name,6,20.68%,0,6,20.68%,0.6559,6.6559,22.95%,0.0000,6.6559,22.95%,-
Candidate B Name,5,17.24%,0,5,17.24%,0,5,17.24%,2.0937,7.0937,24.46%,3.0000,10.0937,34.8%,-2.8436,7.2501,25.0%,0
Candidate F Name,3,10.34%,0,3,10.34%,0.0937,3.0937,10.66%,-3.0937,0,0.0%,0,0,0.0%,0,0,0.0%,0
Candidate D Name,2,6.89%,-2,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0
Active Ballots,29,,,28,,,27.9997,,,27.9997,,,27.6249,,,21.7503,,
Active Ballots,29,,,28,,,27.9997,,,27.9997,,,27.6249,,,27.6244,,
Current Round Threshold,7.2501,,,7.2501,,,7.2501,,,7.2501,,,7.2501,,,7.2501,,
Inactive Ballots by Overvotes,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0
Inactive Ballots by Skipped Rankings,1,,1,2,,0,2,,0,2,,0.1874,2.1874,,0.0000,2.1874,,0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Candidate B Name,5,17.24%,0,5,17.24%,0,5,17.24%,2.1111,7.1111,24.52%,2.1111,9.22
Candidate E Name,4,13.79%,0.7777,4.7777,16.47%,1.0000,5.7777,19.92%,0.0000,5.7777,19.92%,-5.7777,0,0.0%,0,0,0.0%,0
Candidate F Name,3,10.34%,0.1111,3.1111,10.72%,0.1111,3.2222,11.11%,-3.2222,0,0.0%,0,0,0.0%,0,0,0.0%,0
Candidate D Name,2,6.89%,0.1111,2.1111,7.27%,-2.1111,0,0.0%,0,0,0.0%,0,0,0.0%,0,0,0.0%,0
Active Ballots,29,,,28.9999,,,27.9999,,,27.9999,,,27.5555,,,24.0000,,
Active Ballots,29,,,28.9999,,,27.9999,,,27.9999,,,27.5555,,,27.5549,,
Current Round Threshold,8,,,8,,,8,,,8,,,8,,,8,,
Inactive Ballots by Overvotes,0,,0,0,,0,0,,0,0,,0,0,,0,0,,0
Inactive Ballots by Skipped Rankings,1,,0,1,,1,2,,0,2,,0.2222,2.2222,,0.0000,2.2222,,0
Expand Down

0 comments on commit bd33aae

Please sign in to comment.