Files
pokerfreak/src/exploit/bet_ratio.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

17 lines
609 B
Rust

use super::pot_trace::{contribution, pot_before};
use crate::game::ActionRecord;
/// Per record: chips added divided by the pot before it. `None` if the amount or the pot
/// is unknown, or the pot is empty. Only meaningful for bets, raises and all-ins.
pub fn bet_ratios(history: &[ActionRecord]) -> Vec<Option<f64>> {
pot_before(history)
.into_iter()
.enumerate()
.map(|(index, pot)| {
let pot = pot.filter(|p| *p > 0.0)?;
let ratio = contribution(history, index)? / pot;
Some(ratio).filter(|r| r.is_finite())
})
.collect()
}