Pure CFR+ core over a 169-class abstraction, push/fold and open/call/3-bet games, Nash/Kuhn/plausibility/lookup tests, chartgen binary, frozen equity and charts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
60 lines
1.6 KiB
Rust
60 lines
1.6 KiB
Rust
//! The five seats the charts distinguish in 6-max. The big blind is always the modelled
|
|
//! opponent (caller / defender), so it has no chart of its own as first actor.
|
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
|
|
pub enum Seat {
|
|
Early,
|
|
Middle,
|
|
Cutoff,
|
|
Button,
|
|
SmallBlind,
|
|
}
|
|
|
|
impl Seat {
|
|
pub const ALL: [Seat; 5] = [Seat::Early, Seat::Middle, Seat::Cutoff, Seat::Button, Seat::SmallBlind];
|
|
|
|
pub fn label(self) -> &'static str {
|
|
match self {
|
|
Seat::Early => "EP",
|
|
Seat::Middle => "MP",
|
|
Seat::Cutoff => "CO",
|
|
Seat::Button => "BTN",
|
|
Seat::SmallBlind => "SB",
|
|
}
|
|
}
|
|
|
|
/// Players who still act behind this seat before the big blind: the modelled "field".
|
|
pub fn players_behind(self) -> usize {
|
|
match self {
|
|
Seat::Early => 4,
|
|
Seat::Middle => 3,
|
|
Seat::Cutoff => 2,
|
|
Seat::Button => 1,
|
|
Seat::SmallBlind => 0,
|
|
}
|
|
}
|
|
|
|
/// Postflop the big blind acts before every seat except the small blind.
|
|
pub fn is_in_position_against_big_blind(self) -> bool {
|
|
self != Seat::SmallBlind
|
|
}
|
|
|
|
pub fn posted_blind(self) -> f64 {
|
|
if self == Seat::SmallBlind {
|
|
super::spot_params::SMALL_BLIND
|
|
} else {
|
|
0.0
|
|
}
|
|
}
|
|
|
|
/// Money in the pot from players that fold in the modelled line (the small blind when
|
|
/// somebody else is the first actor).
|
|
pub fn dead_money(self) -> f64 {
|
|
if self == Seat::SmallBlind {
|
|
0.0
|
|
} else {
|
|
super::spot_params::SMALL_BLIND
|
|
}
|
|
}
|
|
}
|