Files
pokerfreak/src/exploit/range_spec.rs
T

29 lines
899 B
Rust

use crate::read::made::Made;
/// A villain's estimated holdings as data; the engine turns it into a predicate.
///
/// A hand is in the range when its preflop percentile lies in `[lo, hi]`
/// (0 = best hand) and it satisfies every `Continuation`.
#[derive(Clone, Debug, PartialEq)]
pub struct RangeSpec {
pub lo: f64,
pub hi: f64,
pub continues: Vec<Continuation>,
}
/// "Villain bet or raised when the board had `board_len` cards": only hands at least
/// `min_made` at that point stay in — plus drawing hands when `draws_continue`.
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Continuation {
pub board_len: usize,
pub min_made: Made,
pub draws_continue: bool,
}
impl RangeSpec {
/// The best `top` fraction of starting hands, no postflop filter.
pub fn top(top: f64) -> RangeSpec {
RangeSpec { lo: 0.0, hi: top, continues: Vec::new() }
}
}