Files
pokerfreak/src/exploit/range_guess.rs
T
mmintel 836c16c9a4 Sprechweise geputzt: kein echt/live/Mensch mehr in Kommentaren und Texten
Die Welt soll nichts verraten. Woerter, die ein Gegenueber implizieren (echt vs. unecht,
live, Mensch), sind aus Prosa, Kommentaren und Docstrings raus; Namen (mensch_ruhe_s,
echte_chops) und der Altwert "echt" im Spielplan bleiben. Nur Kommentare und Docstrings
angefasst, damit keine Einrueckung faellt.
2026-11-01 22:11:05 +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)
}