struct Args {
- /// Ranking distribution skewness
+ /// Ranking distribution
+ #[arg(short, default_value_t = String::from("lognormal"))]
+ distribution: String,
+
+ /// Skewness of the ranking
#[arg(short)]
skewness: Option<String>,
}
let ranked: Vec<String> = input();
let num = ranked.len() as i32;
- let _prio1 = delta(num);
- let _prio2 = exp(num);
- let prio3 = lognormal(num, skew);
+
+ let prio = if args.distribution == String::from("delta") {
+ delta(num)
+ } else if args.distribution == String::from("exponential") {
+ exp(num)
+ } else { // Default
+ lognormal(num, skew)
+ };
if DEBUG {
for l in ranked.iter() {
eprintln!("\x08\x08.");
}
- output(&prio3, &ranked);
+ output(&prio, &ranked);
}