Sim-Personas raisen vorflop nur Premiums, die Engine liest SB gegen BB aus der Chart (heads-up 93 % Open, 93 % BB-Verteidigung; echt 24 % / 34 %). Die Klassenböden der Basis verdeckten den zu breiten Prior, BETTORs Bayes-Lesung reichte ihn durch. SIM_VORFLOP (Sim-Gegner nach PHH-Frequenzen) und VORFLOP_BAND (Engine-Band je vpip-Stufe aus PHH, 1 Mio. Hände) schließen das: BETTOR geeicht (Equity-Fehler +0,001), Kandidat BETTOR+ VORFLOP_BAND gg. live pool-phh +4,92 ±4,71, Pool-Ruf echt +8,15 ±5,67, Rest offen; Pflichtfälle bestanden (35/43), Familie C +38 637 bb. Replay je Paarart (River-Mittelpaar 95 -> 50 % Fold). Beide Schalter aus = bitgleich. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
45 lines
1.9 KiB
Rust
45 lines
1.9 KiB
Rust
use super::preflop_role::PreflopRole;
|
|
use super::profile::Profile;
|
|
use super::range_guess::DEFAULT_VPIP;
|
|
|
|
/// A regular preflop raise frequency (six-max).
|
|
pub const DEFAULT_PFR: f64 = 0.18;
|
|
const MIN_STRETCH: f64 = 0.5;
|
|
const MAX_STRETCH: f64 = 1.8;
|
|
|
|
fn frequency(x: Option<f64>) -> Option<f64> {
|
|
x.filter(|v| !v.is_nan()).map(|v| v.clamp(0.0, 1.0))
|
|
}
|
|
|
|
/// How much looser (> 1) or tighter (< 1) than the reference player this villain is, for
|
|
/// the kind of action the role is made of. Clamped to `[0.5, 1.8]`; 1.0 without data.
|
|
///
|
|
/// - raising roles: `pfr / 0.18`; without pfr, `sqrt(vpip / 0.30)` (half-strength vpip)
|
|
/// - calling, limping and blind roles: `vpip / 0.30`
|
|
pub fn stretch(role: PreflopRole, profile: Option<Profile>) -> f64 {
|
|
stretch_upto(role, profile, MAX_STRETCH)
|
|
}
|
|
|
|
/// `stretch` with the upper clamp at `max`. The measured blind-vs-blind band (`vorflop_band`) is a share of
|
|
/// the whole range, not a chart: a calling station (vpip 0.9) defends all of it, three times the pool, so
|
|
/// that band stretches up to 4.
|
|
pub fn stretch_upto(role: PreflopRole, profile: Option<Profile>, max: f64) -> f64 {
|
|
let profile = profile.unwrap_or_default();
|
|
let (vpip, pfr) = (frequency(profile.vpip), frequency(profile.pfr));
|
|
let raw = if role.is_raising() {
|
|
pfr.map(|f| f / DEFAULT_PFR)
|
|
.or_else(|| vpip.map(|v| (v / DEFAULT_VPIP).sqrt()))
|
|
} else {
|
|
vpip.map(|v| v / DEFAULT_VPIP)
|
|
};
|
|
raw.unwrap_or(1.0).clamp(MIN_STRETCH, max.max(MIN_STRETCH))
|
|
}
|
|
|
|
/// A band `[lo, hi]` for a player `factor` times as loose as the reference: the upper
|
|
/// edge moves out by `factor`, the lower edge in by `1 / factor` (looser players raise
|
|
/// less often with their best hands, so fewer hands are excluded at the top).
|
|
/// Width is non-decreasing in `factor`.
|
|
pub fn stretched(lo: f64, hi: f64, factor: f64) -> (f64, f64) {
|
|
(lo / factor, hi * factor)
|
|
}
|