pub struct GameConfig { /* private fields */ }Expand description
Setup for betting starting from a given (partial or complete) board.
Build one with GameConfig::new and the with_* methods. Without
them the game has no bet sizes, so every street is checked down.
use native_solver::{build_tree, Card, Chips, GameConfig};
let board: Vec<Card> = ["Ks", "Th", "7s", "4d", "2s"]
.iter()
.map(|s| s.parse())
.collect::<Result<_, _>>()?;
let config = GameConfig::new(board, Chips::whole(100), Chips::whole(100))
.with_bet_sizes([0.5, 1.0])
.with_max_raises(1);
assert_eq!(build_tree(&config)?.num_decision_nodes, 8);Implementations§
Source§impl GameConfig
impl GameConfig
Sourcepub fn new(board: Vec<Card>, pot: Chips, effective_stack: Chips) -> GameConfig
pub fn new(board: Vec<Card>, pot: Chips, effective_stack: Chips) -> GameConfig
A game on board with pot in the middle and effective_stack behind.
board is the flop, turn, or river (3, 4, or 5 cards). The game starts with
no bet sizes, no raises, and no suit-isomorphism reduction.
Sourcepub fn with_bet_sizes(self, bet_sizes: impl Into<Vec<f64>>) -> GameConfig
pub fn with_bet_sizes(self, bet_sizes: impl Into<Vec<f64>>) -> GameConfig
Sets the bet and raise sizes, as fractions of the pot, for every street.
Each amount is rounded half-to-even to a whole Chips unit, clipped to
the available stack, and deduplicated. No all-in size is added: include a
large enough fraction for one.
Sourcepub fn with_max_raises(self, max_raises: u32) -> GameConfig
pub fn with_max_raises(self, max_raises: u32) -> GameConfig
Sets the maximum number of raises per street (the count resets each street).
Sourcepub fn with_suit_isomorphism(self, suit_isomorphism: bool) -> GameConfig
pub fn with_suit_isomorphism(self, suit_isomorphism: bool) -> GameConfig
Groups strategically identical chance cards to shrink the tree.
Cards of the same rank whose suits are both absent from the board are interchangeable, so the tree recurses once per such class and the trainer derives the other members’ values by relabeling suits. Results match the unreduced tree (see the conventions). Off by default.
Sourcepub fn effective_stack(&self) -> Chips
pub fn effective_stack(&self) -> Chips
Each player’s remaining stack at the start of the first street.
Sourcepub fn max_raises(&self) -> u32
pub fn max_raises(&self) -> u32
Maximum number of raises per street.
Sourcepub fn suit_isomorphism(&self) -> bool
pub fn suit_isomorphism(&self) -> bool
Whether chance nodes are grouped by suit isomorphism.
Trait Implementations§
Source§impl Clone for GameConfig
impl Clone for GameConfig
Source§impl Debug for GameConfig
impl Debug for GameConfig
Source§impl PartialEq for GameConfig
impl PartialEq for GameConfig
impl StructuralPartialEq for GameConfig
Auto Trait Implementations§
impl Freeze for GameConfig
impl RefUnwindSafe for GameConfig
impl Send for GameConfig
impl Sync for GameConfig
impl Unpin for GameConfig
impl UnsafeUnpin for GameConfig
impl UnwindSafe for GameConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more