feat: refactor AlgorithmicEvaluator to stateless, add game engine module and holdem_sim CLI
- Refactor AlgorithmicEvaluator from stateful Arc<Evaluator> wrapper to pure stateless evaluator with zero-allocation construction - Extract shared evaluation logic into pub(crate) methods, eliminating ~220 lines of duplicated code from Evaluator - Add game module: table, hand runner, tournament, bots, config, stats - Add holdem_sim CLI binary crate for running simulations - Convert MathEvaluator to thread-safe singleton with Arc<Inner> pattern - Replace heap-allocated combination generation with const-generics stack-based approach in AlgorithmicEvaluator::evaluate_n_card_hand - Add thiserror 2 dependency for GameError derive - Update docs: README, ACHIEVEMENTS, ROADMAP
This commit is contained in:
parent
dd605e8a66
commit
17d0440c86
43 changed files with 12329 additions and 494 deletions
52
holdem_core/src/game/mod.rs
Normal file
52
holdem_core/src/game/mod.rs
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
//! Texas Hold'em simulation engine.
|
||||
//!
|
||||
//! This module provides the game engine components for running Texas Hold'em poker
|
||||
//! simulations, modeled after the Meerkat API from the University of Alberta's
|
||||
//! Poker Academy / OpenTestbed project.
|
||||
//!
|
||||
//! # Module Structure
|
||||
//!
|
||||
//! - [`types`] — Core shared types: [`PlayerId`], [`ChipCount`], [`SeatIndex`], [`GameError`]
|
||||
//! - [`action`] — Player action types and validation
|
||||
//! - [`player_info`] — Per-player state visible to all players
|
||||
//! - [`game_info`] — Read-only game state snapshot for bots
|
||||
//! - [`player`] — Standardized bot interface ([`HoldemPlayer`]) and internal [`Seat`] struct
|
||||
//! - [`betting`] — Betting structures and limits
|
||||
//! - [`pot`] — Pot management with side pot algorithm
|
||||
//! - [`hand_runner`] — Core state machine that executes a single hand
|
||||
//! - [`table`] — Table management with seating, button rotation, and hand execution
|
||||
//! - [`tournament`] — Tournament formats, blind schedules, and prize structures
|
||||
//! - [`config`] — TOML-based configuration system for game simulations
|
||||
|
||||
pub mod action;
|
||||
pub mod betting;
|
||||
pub mod bot_factory;
|
||||
pub mod bots;
|
||||
pub mod config;
|
||||
pub mod game_info;
|
||||
pub mod hand_runner;
|
||||
pub mod player;
|
||||
pub mod player_info;
|
||||
pub mod pot;
|
||||
pub mod simulation;
|
||||
pub mod stats;
|
||||
pub mod table;
|
||||
pub mod tournament;
|
||||
pub mod types;
|
||||
|
||||
// Re-export core types for convenience.
|
||||
pub use action::{Action, PlayerAction};
|
||||
pub use betting::BetLimit;
|
||||
pub use bot_factory::create_bot;
|
||||
pub use bots::{CallBot, FoldBot, RandomBot, RaiseBot};
|
||||
pub use config::{BetLimitConfig, BotConfig, GameConfig, OutputConfig, SimulationConfig};
|
||||
pub use game_info::GameInfo;
|
||||
pub use hand_runner::{HandResult, HandRunner, HandState};
|
||||
pub use player::{HoldemPlayer, Seat};
|
||||
pub use player_info::{PlayerInfo, PlayerState};
|
||||
pub use pot::{Pot, PotManager, PotWinner};
|
||||
pub use simulation::run_cash_game;
|
||||
pub use stats::{PlayerStats, SimulationStats};
|
||||
pub use table::{Table, TableConfig};
|
||||
pub use tournament::{BlindLevel, BlindSchedule, GameType, PrizeStructure, Tournament};
|
||||
pub use types::{ChipCount, GameError, PlayerId, SeatIndex, MAX_SEATS, MIN_PLAYERS};
|
||||
Loading…
Add table
Add a link
Reference in a new issue