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>
17 lines
609 B
Rust
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()
|
|
}
|