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, } /// "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` — plus /// a bluff fraction: hands below the floor are admitted so that they make up /// `bluff_share` of what passes (`engine::range_filter`). 0 = a pure value range. #[derive(Clone, Copy, Debug, PartialEq)] pub struct Continuation { pub board_len: usize, pub min_made: Made, pub draws_continue: bool, pub bluff_share: f64, } 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() } } }