Files
pokerfreak/src/exploit/band_bounds.rs
T
mmintelandClaude Opus 5.5 9a9c6c946d Range narrowing from action history, position from inferred button
Wire: optional history decoding. exploit::range_model: role band + postflop
continuations. preflop::button / seat_position: button inference from blinds.

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

20 lines
550 B
Rust

/// Narrowest band the equity code can sample from.
pub const MIN_WIDTH: f64 = 0.03;
/// Forces any pair into `0 <= lo`, `hi <= 1`, `hi - lo >= 0.03`. NaN counts as the widest
/// choice on that side (`lo = 0`, `hi = 1`). The upper edge is kept when possible,
/// the lower edge gives way.
pub fn bounded(lo: f64, hi: f64) -> (f64, f64) {
let hi = if hi.is_nan() {
1.0
} else {
hi.clamp(MIN_WIDTH, 1.0)
};
let lo = if lo.is_nan() {
0.0
} else {
lo.clamp(0.0, hi - MIN_WIDTH)
};
(lo, hi)
}