Files
pokerfreak/src/exploit/bluff_share.rs
T
mmintelandClaude Opus 5.5 1ad6f76088 Bluffing and bluff catching driven by opponent frequencies
- exploit::fold_chance: documented foldToBet -> P(fold) map by bet size, per villain
- engine: two-branch EV for every raise (fold branch, called branch vs calling range)
- semibluffs first, pure bluffs heads-up above a fold and EV threshold
- betting ranges keep a bluff share (size, street, style or new profile.aggression)
- guards: no bluffs vs never-folders, no bluff catch vs ranges without bluffs
- steal width in unopened pots from how often the blinds fold
- combo-list sampling for narrow two-card ranges

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

48 lines
1.9 KiB
Rust

//! What part of an opponent's betting range is a bluff.
//!
//! | step | rule |
//! |---|---|
//! | base | `s / (1 + 2s)` for a bet of `s` pots: the river share at which a caller is indifferent (Chen/Ankenman, "The Mathematics of Poker"); unknown or broken size counts as 0.66 |
//! | street | river 1.0, turn 0.6, flop 0.5 (earlier, draws do the bluffing and already stay in the range), preflop 0 |
//! | style | nit 0.4, calling station 0.5 (passive players bet for value), loose-aggressive 1.5, otherwise 1.0 |
//! | aggression | when the profile gives it, `aggression / 0.45` (0.45 = an average aggression frequency) replaces the style factor, clamped to [0, 2] |
//! | cap | at most 0.6 |
use super::profile::Profile;
use super::style::{classify, Style};
use crate::game::Street;
pub const NEUTRAL_RATIO: f64 = 0.66;
pub const MAX_BLUFF_SHARE: f64 = 0.6;
const AVERAGE_AGGRESSION: f64 = 0.45;
const MAX_FACTOR: f64 = 2.0;
fn street_factor(street: Street) -> f64 {
match street {
Street::Preflop => 0.0,
Street::Flop => 0.5,
Street::Turn => 0.6,
Street::River => 1.0,
}
}
fn style_factor(profile: Option<&Profile>) -> f64 {
let Some(p) = profile else { return 1.0 };
match p.aggression.filter(|a| !a.is_nan()) {
Some(a) => (a.clamp(0.0, 1.0) / AVERAGE_AGGRESSION).clamp(0.0, MAX_FACTOR),
None => match classify(p) {
Style::Nit => 0.4,
Style::CallingStation => 0.5,
Style::LooseAggressive => 1.5,
Style::Regular | Style::Unknown => 1.0,
},
}
}
/// Bluff share of the range that bet `ratio` pots on `street`. Always in `[0, MAX_BLUFF_SHARE]`.
pub fn bluff_share(profile: Option<&Profile>, ratio: Option<f64>, street: Street) -> f64 {
let s = ratio.filter(|r| r.is_finite() && *r > 0.0).unwrap_or(NEUTRAL_RATIO);
let balanced = s / (1.0 + 2.0 * s);
(balanced * street_factor(street) * style_factor(profile)).clamp(0.0, MAX_BLUFF_SHARE)
}