From 5024496f61ec4eb752a208fbce8a6d96e0a5b27e Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Mon, 9 Aug 2021 18:19:06 +1000 Subject: [PATCH] Add new ERS97 test --- docs/validation.md | 9 +++--- tests/data/ers97.blt | 71 +++++++++++++++++++++++++++++++++++++++++++ tests/data/ers97.csv | 15 +++++++++ tests/data/ers97.ods | Bin 0 -> 14877 bytes tests/ers97.rs | 21 +++++++++++++ 5 files changed, 112 insertions(+), 4 deletions(-) create mode 100644 tests/data/ers97.blt create mode 100644 tests/data/ers97.csv create mode 100644 tests/data/ers97.ods diff --git a/docs/validation.md b/docs/validation.md index 5414526..94e1baf 100644 --- a/docs/validation.md +++ b/docs/validation.md @@ -5,9 +5,9 @@ STV-counting software is frequently validated empirically by comparing the resul | Method | Election | Comparator | Included test case | |-|-|-|-| | Scottish STV | [2007 Glasgow council Linn ward election](https://web.archive.org/web/20121004213938/http://www.glasgow.gov.uk/en/YourCouncil/Elections_Voting/Election_Results/ElectionScotland2007/LGWardResults.htm?ward=1&wardname=1%20-%20Linn) | eSTV 2.0.16 (official) | ✓ | -| OpenTally Meek | [Ballot papers derived from the ERS97 model election](https://yingtongli.me/blog/2021/01/04/ers97.html) | [Algorithm 123](https://www.dia.govt.nz/diawebsite.NSF/Files/meekm/%24file/meekm.pdf) | ✓ | -| Meek STV (2006) | Ballot papers derived from the ERS97 model election | [OpenSTV 1.7](https://github.com/Conservatory/openstv) | ✓ | -| Meek STV (New Zealand) | Ballot papers derived from the ERS97 model election | OpenSTV 1.7, [Hill's nzmeek 6.7.7](https://yingtongli.me/blog/2021/07/08/nzmeek.html) | ✓ | +| OpenTally Meek | [Reverse engineered ballot papers for the ERS97 model election](https://yingtongli.me/blog/2021/01/04/ers97.html) | [Algorithm 123](https://www.dia.govt.nz/diawebsite.NSF/Files/meekm/%24file/meekm.pdf) | ✓ | +| Meek STV (2006) | Reverse engineered ballot papers for the ERS97 model election | [OpenSTV 1.7](https://github.com/Conservatory/openstv) | ✓ | +| Meek STV (New Zealand) | Reverse engineered ballot papers for the ERS97 model election | OpenSTV 1.7, [Hill's nzmeek 6.7.7](https://yingtongli.me/blog/2021/07/08/nzmeek.html) | ✓ | | Australian Senate STV | [2019 Tasmanian Senate election](https://results.aec.gov.au/24310/Website/SenateDownloadsMenu-24310-Csv.htm) | EasyCount (official) | ✓ | | Australian Senate STV | [2019 NSW Senate election](https://results.aec.gov.au/24310/Website/SenateDownloadsMenu-24310-Csv.htm) | EasyCount (official) | | | Australian Capital Territory STV | [2020 Kurrajong Legislative Assembly election](https://www.elections.act.gov.au/elections_and_voting/2020_legislative_assembly_election/ballot-paper-preference-data-2020-election) | [eVACS 2020](https://www.elections.act.gov.au/elections_and_voting/electronic_voting_and_counting) (official) | ✓ | @@ -16,7 +16,8 @@ STV-counting software is frequently validated empirically by comparing the resul | Cambridge STV | [2003 Cambridge City Council election](https://web.archive.org/web/20070204083508/http://stv.sourceforge.net/) | OpenSTV 1.7, [ChoicePlus Pro 2.1](https://www.votingsolutions.com/cpdetail.htm) (official) | ✓ | | Wright STV | [EVE Online CSM 15 election](https://www.eveonline.com/news/view/meet-the-new-council) | [ccp-wright-stv](https://github.com/ccpgames/ccp-wright-stv) (official) | ✓ | | PRSA 1977 | [*Proportional Representation Manual*](https://www.prsa.org.au/publicat.htm#p2) [example 1](https://www.prsa.org.au/utopiatc.pdf) | [Model result](https://www.prsa.org.au/example1.pdf) (official) | ✓ | -| ERS97 | Ballot papers derived from the ERS97 model election | [Model result](https://www.electoral-reform.org.uk/latest-news-and-research/publications/how-to-conduct-an-election-by-the-single-transferable-vote-3rd-edition/#sub-section-24) (official) | ✓ | +| ERS97 | [Reverse engineered ballot papers for the ERS97 model election](https://yingtongli.me/blog/2021/01/04/ers97.html) | [Model result](https://www.electoral-reform.org.uk/latest-news-and-research/publications/how-to-conduct-an-election-by-the-single-transferable-vote-3rd-edition/#sub-section-24) (official) | ✓ | +| ERS97 | [Joe Otten/eSTV ballot papers for the ERS97 model election](https://web.archive.org/web/20020606014623/http://estv.otten.co.uk/) | [Model result](https://www.electoral-reform.org.uk/latest-news-and-research/publications/how-to-conduct-an-election-by-the-single-transferable-vote-3rd-edition/#sub-section-24) (official) | ✓ | # References diff --git a/tests/data/ers97.blt b/tests/data/ers97.blt new file mode 100644 index 0000000..22a2444 --- /dev/null +++ b/tests/data/ers97.blt @@ -0,0 +1,71 @@ +# Comment: Ballot papers for the ERS97 model election - all votes - ERS97 +# Source: Joe Otten, bundled with eSTV 1.40 at https://web.archive.org/web/20020606014623/http://estv.otten.co.uk/ +# Contributor: RunasSudo +11 6 +8 1 2 0 +3 1 3 0 +14 1 4 0 +34 1 5 0 +1 1 6 0 +4 1 7 0 +1 1 8 0 +4 1 9 3 0 +3 1 9 4 0 +2 1 9 6 0 +3 1 9 7 0 +4 1 9 8 0 +9 1 9 0 +4 1 10 3 0 +5 1 10 4 0 +3 1 10 6 0 +3 1 10 7 0 +6 1 10 8 0 +10 1 10 0 +1 1 11 5 0 +1 1 11 0 +11 1 0 +105 2 0 +91 3 0 +90 4 0 +81 5 0 +64 6 0 +11 7 6 0 +36 7 8 0 +12 7 0 +55 8 0 +3 9 3 0 +2 9 4 0 +2 9 5 3 0 +1 9 5 4 0 +15 9 5 0 +2 9 6 0 +2 9 8 0 +2 10 3 0 +2 10 4 0 +2 10 5 6 0 +1 10 5 7 6 0 +2 10 5 8 0 +11 10 5 0 +1 10 6 0 +1 10 7 4 0 +1 10 8 0 +1 10 0 +2 11 2 0 +4 11 3 0 +1 11 4 0 +5 11 7 8 0 +10 11 8 0 +1 11 0 +0 +"Smith" +"Duke" +"Prince" +"Freeman" +"Carpenter" +"Baron" +"Abbot" +"Vicar" +"Wright" +"Glazier" +"Monk" +"ERS Model - 1997 Edition" diff --git a/tests/data/ers97.csv b/tests/data/ers97.csv new file mode 100644 index 0000000..c139f98 --- /dev/null +++ b/tests/data/ers97.csv @@ -0,0 +1,15 @@ +Stage:,1,,2,,4,,6,,7,,8, +Comment:,First preferences,,Surplus of Smith,,Exclusion of Monk,,"Exclusion of Glazier, Wright",,Surplus of Carpenter,,Exclusion of Abbot, +Smith,134,EL,107.58,EL,107.58,EL,107.58,EL,107.58,EL,107.58,EL +Duke,105,H,106.68,H,108.68,EL,108.68,EL,108.68,EL,108.68,EL +Prince,91,H,91.63,H,95.63,H,102.31,H,104.31,EL,104.31,EL +Freeman,90,H,92.94,H,93.94,H,99.62,H,100.62,H,101.62,EL +Carpenter,81,H,88.14,H,88.35,H,122.35,EL,107.58,EL,107.58,EL +Baron,64,H,64.21,H,64.21,H,68.26,H,70.26,H,82.26,H +Abbot,59,H,59.84,H,64.84,H,67.1,H,68.1,H,2.1,EX +Vicar,55,H,55.21,H,65.21,H,70.31,H,72.31,H,113.31,EL +Wright,27,H,32.25,H,32.25,H,0,EX,0,EX,0,EX +Glazier,24,H,30.51,H,30.51,H,0,EX,0,EX,0,EX +Monk,23,H,23.42,H,0,EX,0,EX,0,EX,0,EX +Non-transferable,0,,0.59,,1.8,,6.79,,13.56,,25.56, +Votes required,,,,,,,105.87,,104.13,,96.41, diff --git a/tests/data/ers97.ods b/tests/data/ers97.ods new file mode 100644 index 0000000000000000000000000000000000000000..456f6f396d47b11d98d511ae57d5127c6a16a4ef GIT binary patch literal 14877 zcmd73Wmp}{wl)gE-8Hy73GVLh?l5s@;t<>+XmEE8?(PACJHg%E^&{upb=KPZTWjBY z{@u|}KV5S^J>DAC)itWR#&{K^!NAc$K%hZD=!IaEgRD8j89+clexL7uf!J8s0D$iH z07H9wYYSsTpoN_+ql>KxgPoz1g%g9FJ;2t)&e+)oU<+h$vUda+nmCyQ06>L*!F-4L zAHjYv3ESD4T9`RI{ui1P6C=>h&f3V(k@0`0Wom6_2n76Zwcagt{?B#c{*8t9cJ|Kp zzg7Q(jd*{fXJ~8;um-$0)b2mo`FAz`ekS&YwgBt@WsUZZc4m$MC#U~?8=ZiLK%s`~CkT@b4uXLt6_|fD@3x(ZqB#e$+PL z6LR1gPY_^iL4Xkg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}8(C_544>S;& z1%9?@EwxquG$*J#y!Aj~P~+sR05nf-I&!x9U|wd)1!bNL+r8+5jw(Lmbqt!NpHYM? zcmM<;qDU&#bbFTU|-@vodd`0JCp4ZBER#} zXJnpR8*mM@wjf8Sd;sba(R7|X^gIcl`Y327fy)XLRJEcRdCvM_-%1aQJwILi(*GUC z3JrUC`}|H1pacIM#sd9-4)V_&t>69gr~JX#`gg5A@A&WV*Pp*t-i!at$@bn`IDpd{}rX{Z&3c^Z2dFJZw}R;a{FHV_ZIz?!}ZTNzgb*=3d4I3{5#ISa=QK* z>0d1}{~M&ga=iW-=U*+#{u`Ws<$V1!(!W}?^fyR<<$(P&&TkgjpMv_~|9(dQ7bon$ z!Tz8%{gv?aJJ04%k$(sKAK&rL5&PpM{zLPxteM}0s6XZFdvx}ls`y{@sDIb`YgY2_ zu+pH395}7w_pBK7+C(nODjl2yytC$fS|k|fOn^p%liA*{{bUTiB13j literal 0 HcmV?d00001 diff --git a/tests/ers97.rs b/tests/ers97.rs index 5a38704..57f48dc 100644 --- a/tests/ers97.rs +++ b/tests/ers97.rs @@ -40,3 +40,24 @@ fn ers97old_rational() { utils::read_validate_election::("tests/data/ers97old.csv", "tests/data/ers97old.blt", stv_opts, None, &["nt", "vre"]); } + +#[test] +fn ers97_rational() { + let stv_opts = stv::STVOptionsBuilder::default() + .round_surplus_fractions(Some(2)) + .round_values(Some(2)) + .round_votes(Some(2)) + .round_quota(Some(2)) + .quota(stv::QuotaType::DroopExact) + .quota_criterion(stv::QuotaCriterion::GreaterOrEqual) + .quota_mode(stv::QuotaMode::ERS97) + .surplus(stv::SurplusMethod::EG) + .transferable_only(true) + .exclusion(stv::ExclusionMethod::ByValue) + .early_bulk_elect(false) + .bulk_exclude(true) + .defer_surpluses(true) + .build().unwrap(); + + utils::read_validate_election::("tests/data/ers97.csv", "tests/data/ers97.blt", stv_opts, None, &["nt", "vre"]); +}