Files
pokerfreak/src/exploit/range_guess.rs
T
mmintelandClaude Opus 5.5 ec800a1672 Preflop charts and exploitation layer
Hand percentiles (169-class equity ranking, Omaha-5 structural score with
empirical CDF), position/situation inference, position x situation charts,
all-in-or-fold charts, pot-odds all-in calls, advise(); exploit style
classification, threshold adjustment and villain range guess.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 12:00:21 +01:00

28 lines
1.1 KiB
Rust

use super::range_narrowing::{bet_factor, multiway_factor, stickiness_factor, street_factor};
use crate::game::{Spot, Villain};
/// Baseline when the villain has no vpip figure (typical full-ring/six-max regular).
pub const DEFAULT_VPIP: f64 = 0.30;
const MIN_FRACTION: f64 = 0.05;
/// Estimated fraction of starting hands (best first) this villain still holds here,
/// in `(0, 1]`. Used as `VillainRange::Top` for the equity estimate.
///
/// `vpip` (default 0.30) x street (1, .8, .62, .5) x bet size (`to_call / pot`, narrower)
/// x multiway-passive bonus x stickiness (foldToBet), clamped to `[0.05, 1]`.
pub fn top_fraction(spot: &Spot, villain: &Villain) -> f64 {
let profile = villain.profile.unwrap_or_default();
let vpip = profile
.vpip
.filter(|v| !v.is_nan())
.map_or(DEFAULT_VPIP, |v| v.clamp(0.02, 1.0));
let someone_bet = spot.to_call > 0.0;
let live = spot.live_villains().count();
(vpip
* street_factor(spot.street)
* bet_factor(spot.to_call, spot.pot)
* multiway_factor(live, someone_bet)
* stickiness_factor(profile.fold_to_bet))
.clamp(MIN_FRACTION, 1.0)
}