Code fixups

This commit is contained in:
RunasSudo 2021-06-12 21:16:53 +10:00
parent e059a6a3d9
commit 5d491687b4
No known key found for this signature in database
GPG Key ID: 7234E476BF21C61A
5 changed files with 7 additions and 1 deletions

View File

@ -82,6 +82,7 @@ struct STV {
#[clap(help_heading=Some("ROUNDING"), long, value_name="dps")]
round_quota: Option<usize>,
/// How to calculate votes to credit to candidates in surplus transfers
#[clap(help_heading=Some("ROUNDING"), long, possible_values=&["single_step", "by_value", "per_ballot"], default_value="single_step", value_name="mode")]
sum_surplus_transfers: String,
@ -96,7 +97,7 @@ struct STV {
#[clap(help_heading=Some("QUOTA"), short='c', long, possible_values=&["geq", "gt"], default_value="gt", value_name="criterion")]
quota_criterion: String,
// Whether to apply a form of progressive quota
/// Whether to apply a form of progressive quota
#[clap(help_heading=Some("QUOTA"), long, possible_values=&["static", "ers97"], default_value="static", value_name="mode")]
quota_mode: String,
@ -107,6 +108,7 @@ struct STV {
#[clap(help_heading=Some("STV VARIANTS"), short='s', long, possible_values=&["wig", "uig", "eg", "meek"], default_value="wig", value_name="method")]
surplus: String,
/// Order to distribute surpluses
#[clap(help_heading=Some("STV VARIANTS"), long, possible_values=&["by_size", "by_order"], default_value="by_size", value_name="order")]
surplus_order: String,

View File

@ -60,6 +60,7 @@ fn aec_tas19_rational() {
round_votes: Some(0),
round_quota: Some(0),
sum_surplus_transfers: stv::SumSurplusTransfersMode::SingleStep,
normalise_ballots: false,
quota: stv::QuotaType::Droop,
quota_criterion: stv::QuotaCriterion::GreaterOrEqual,
quota_mode: stv::QuotaMode::Static,

View File

@ -34,6 +34,7 @@ fn ers97_rational() {
round_votes: Some(2),
round_quota: Some(2),
sum_surplus_transfers: stv::SumSurplusTransfersMode::SingleStep,
normalise_ballots: false,
quota: stv::QuotaType::DroopExact,
quota_criterion: stv::QuotaCriterion::GreaterOrEqual,
quota_mode: stv::QuotaMode::ERS97,

View File

@ -28,6 +28,7 @@ fn prsa1_rational() {
round_votes: Some(3),
round_quota: Some(3),
sum_surplus_transfers: stv::SumSurplusTransfersMode::SingleStep,
normalise_ballots: false,
quota: stv::QuotaType::Droop,
quota_criterion: stv::QuotaCriterion::GreaterOrEqual,
quota_mode: stv::QuotaMode::Static,

View File

@ -35,6 +35,7 @@ fn scotland_linn07_fixed5() {
round_votes: None,
round_quota: Some(0),
sum_surplus_transfers: stv::SumSurplusTransfersMode::PerBallot,
normalise_ballots: true,
quota: stv::QuotaType::Droop,
quota_criterion: stv::QuotaCriterion::GreaterOrEqual,
quota_mode: stv::QuotaMode::Static,