//! How the number of villains `n` moves the postflop bars. Heads-up (`n <= 1`) //! is the identity; every extra villain (`e = n - 1`) adds: //! //! | quantity | rule | why | //! |------------------|----------------------------------------|--------------------------------------------------| //! | equity realised | `share * 0.97^e` | multiway pots are contested, equity is realised less | //! | call margin | `+ 0.01 * e` | someone else is likelier to hold the better hand | //! | value threshold | `+ 0.05 * e` | a raise must beat several ranges; the absolute bar rises while the fair share `1/(n+1)` falls, so the bar is kept above the heads-up one | //! | semibluffs | only while `n <= 2` | fold equity compounds to near zero against 3+ | /// Per extra villain: factor on the equity share. pub const REALIZATION_PER_EXTRA: f64 = 0.97; /// Per extra villain: added to the call margin. pub const MARGIN_PER_EXTRA: f64 = 0.01; /// Per extra villain: added to the value-raise threshold. pub const VALUE_PER_EXTRA: f64 = 0.05; /// Most villains a semibluff may face. pub const SEMIBLUFF_MAX_VILLAINS: usize = 2; fn extras(villains: usize) -> i32 { villains.saturating_sub(1).min(64) as i32 } /// Equity share after the multiway realisation discount. pub fn realized_share(share: f64, villains: usize) -> f64 { share * REALIZATION_PER_EXTRA.powi(extras(villains)) } pub fn extra_call_margin(villains: usize) -> f64 { MARGIN_PER_EXTRA * f64::from(extras(villains)) } pub fn extra_value_raise(villains: usize) -> f64 { VALUE_PER_EXTRA * f64::from(extras(villains)) } pub fn semibluff_allowed(villains: usize) -> bool { villains <= SEMIBLUFF_MAX_VILLAINS }