Add CSM15 test case for Wright STV
This commit is contained in:
parent
d46eb69f26
commit
dda62bb4a9
48
tests/csm.rs
Normal file
48
tests/csm.rs
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/* OpenTally: Open-source election vote counting
|
||||||
|
* Copyright © 2021 Lee Yingtong Li (RunasSudo)
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
mod utils;
|
||||||
|
|
||||||
|
use opentally::numbers::NativeFloat64;
|
||||||
|
use opentally::stv;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn csm15_float64() {
|
||||||
|
let stv_opts = stv::STVOptions {
|
||||||
|
round_tvs: None,
|
||||||
|
round_weights: None,
|
||||||
|
round_votes: None,
|
||||||
|
round_quota: Some(0),
|
||||||
|
sum_surplus_transfers: stv::SumSurplusTransfersMode::SingleStep,
|
||||||
|
meek_surplus_tolerance: String::new(),
|
||||||
|
normalise_ballots: false,
|
||||||
|
quota: stv::QuotaType::Droop,
|
||||||
|
quota_criterion: stv::QuotaCriterion::GreaterOrEqual,
|
||||||
|
quota_mode: stv::QuotaMode::Static,
|
||||||
|
ties: vec![],
|
||||||
|
surplus: stv::SurplusMethod::WIG,
|
||||||
|
surplus_order: stv::SurplusOrder::BySize,
|
||||||
|
transferable_only: false,
|
||||||
|
exclusion: stv::ExclusionMethod::Wright,
|
||||||
|
meek_nz_exclusion: false,
|
||||||
|
bulk_exclude: true,
|
||||||
|
defer_surpluses: false,
|
||||||
|
meek_immediate_elect: false,
|
||||||
|
pp_decimals: 2,
|
||||||
|
};
|
||||||
|
utils::read_validate_election::<NativeFloat64>("tests/data/CSM15.csv", "tests/data/CSM15.blt", stv_opts, Some(6), &["quota"]);
|
||||||
|
}
|
10536
tests/data/CSM15.blt
Normal file
10536
tests/data/CSM15.blt
Normal file
File diff suppressed because it is too large
Load Diff
43
tests/data/CSM15.csv
Normal file
43
tests/data/CSM15.csv
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
Stage:,1,,3,,4,,6,,7,,9,,10,,12,,13,,15,,16,,18,,19,,21,,22,,24,,25,,27,,28,,30,,31,,33,,34,,36,,37,,39,,40,,42,,43,,45,,46,,48,,49,,51,,52,,54,,55,,58,,59,,62,,63,,67,,68,,72,,73,,77,,78,,82,,83,,87,,88,,92,,93,,97,,98,,102,,103,,109,,110,,118,,119,
|
||||||
|
Comment:,First preferences,,,,Exclusion of Leehams DaWildabeast,,,,Exclusion of Storm Delay,,,,Exclusion of Kalen Tsero,,,,Exclusion of Rheaha Preynar,,,,Exclusion of Dhuras,,,,Exclusion of boernl,,,,Exclusion of Styxx,,,,Exclusion of Murray Rothbardo,,,,Exclusion of Xenuria,,,,Exclusion of Prospektor Schipplock,,,,Exclusion of Komi Valentine,,,,Exclusion of UAxDEATH,,,,Exclusion of Pandora Singularity,,,,Exclusion of PJHustle,,,,Exclusion of Ironwulf,,,,Exclusion of January Valentine,,,,Exclusion of Darius Caliente,,,,Exclusion of Alexis Finch,,,,Exclusion of The Oz,,,,Exclusion of Steadyo,,,,Exclusion of Insidious Sainthood,,,,Exclusion of Meredith en Thielles,,,,Exclusion of Stitch Kaneland,,,,Exclusion of DutchGunner,,,,Exclusion of Jurius Doctor,,,,Exclusion of BlazingBunny,,,,Exclusion of ExookiZ,,,,Exclusion of Juvenius Drakonius,,,,Exclusion of Ikarus Cesaille,,,,Exclusion of Loroseco K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,,,H,,,,H,,,,H,,,,H,,,,H,,,,H,,,,H,,,,H,,,,H,,,,H,,,,H,,,,H,,,,EL,,,,EL,,
|
||||||
|
Quota,3284,,,,3284,,,,3283,,,,3283,,,,3281,,,,3279,,,,3277,,,,3277,,,,3275,,,,3274,,,,3273,,,,3270,,,,3260,,,,3254,,,,3245,,,,3238,,,,3229,,,,3221,,,,3214,,,,3203,,,,3201,,,,3190,,,,3178,,,,3168,,,,3149,,,,3122,,,,3115,,,,3097,,,,2990,,,,2944,,,,,
|
|
BIN
tests/data/CSM15.ods
Normal file
BIN
tests/data/CSM15.ods
Normal file
Binary file not shown.
@ -115,9 +115,11 @@ where
|
|||||||
// Validate candidate votes
|
// Validate candidate votes
|
||||||
for (candidate, votes) in state.election.candidates.iter().zip(candidate_votes) {
|
for (candidate, votes) in state.election.candidates.iter().zip(candidate_votes) {
|
||||||
let count_card = state.candidates.get(candidate).unwrap();
|
let count_card = state.candidates.get(candidate).unwrap();
|
||||||
|
if votes.is_some() {
|
||||||
let votes = votes.unwrap();
|
let votes = votes.unwrap();
|
||||||
approx_eq(&count_card.votes, &votes, cmp_dps, idx, &format!("votes for candidate {}", candidate.name));
|
approx_eq(&count_card.votes, &votes, cmp_dps, idx, &format!("votes for candidate {}", candidate.name));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Validate candidate states
|
// Validate candidate states
|
||||||
let mut candidate_states: Vec<&str> = records.iter().skip(2).map(|r| &r[idx*2 + 2]).collect();
|
let mut candidate_states: Vec<&str> = records.iter().skip(2).map(|r| &r[idx*2 + 2]).collect();
|
||||||
@ -126,6 +128,8 @@ where
|
|||||||
for (candidate, candidate_state) in state.election.candidates.iter().zip(candidate_states) {
|
for (candidate, candidate_state) in state.election.candidates.iter().zip(candidate_states) {
|
||||||
let count_card = state.candidates.get(candidate).unwrap();
|
let count_card = state.candidates.get(candidate).unwrap();
|
||||||
if candidate_state == "" {
|
if candidate_state == "" {
|
||||||
|
}
|
||||||
|
else if candidate_state == "H" {
|
||||||
assert!(count_card.state == CandidateState::Hopeful);
|
assert!(count_card.state == CandidateState::Hopeful);
|
||||||
} else if candidate_state == "EL" || candidate_state == "PEL" {
|
} else if candidate_state == "EL" || candidate_state == "PEL" {
|
||||||
assert!(count_card.state == CandidateState::Elected);
|
assert!(count_card.state == CandidateState::Elected);
|
||||||
|
Loading…
Reference in New Issue
Block a user