Skip to main content

thrust_rl/env/games/
mod.rs

1//! Game environment implementations
2//!
3//! This module contains various game environments for reinforcement learning:
4//! - CartPole: Classic cart-pole balancing task
5//! - FlickeringCartPole: CartPole whose 4-D observation is blanked to zeros
6//!   with a seeded probability `p` (default 0.5) — the Hausknecht & Stone
7//!   (2015) flickering-Atari POMDP protocol. Memory is load-bearing: a
8//!   feedforward policy cannot act on a blanked frame, so recurrence wins by
9//!   construction (issue #287, epic #262)
10//! - MaskedCartPole: CartPole with the two velocity coordinates dropped from
11//!   the observation. Retained as a documented NEGATIVE result — a 500k-step
12//!   run showed a memoryless `[x, theta]` controller solves it, so
13//!   velocity-masking alone does NOT make memory load-bearing (issue #287)
14//! - GridWorld: in-tree `4x4` FrozenLake-style sparse-reward navigation task
15//!   (issue #182, `i64` discrete action `0=Up/1=Right/2=Down/3=Left`, 16-dim
16//!   one-hot observation, absorbing goal/hole terminals + step-cap truncation)
17//! - Snake: Snake game with configurable grid size
18//! - SimpleBandit: Simple multi-armed bandit for testing
19//! - Pong: Single-player Pong vs rule-based opponent
20//! - ContinuousLqr: 1D LQR placeholder env that exercises the continuous
21//!   (`Vec<f32>`) action surface added in issue #61
22//! - PendulumSwingUp: in-tree `Pendulum-v1` swing-up task; the canonical
23//!   continuous-control SAC benchmark (issue #139, length-1 `Vec<f32>` torque
24//!   action, 3-dim `[cos θ, sin θ, θ̇]` observation)
25//! - MountainCarContinuous: in-tree `MountainCarContinuous-v0` classic-control
26//!   task; a sparse/deceptive-reward continuous-control benchmark (issue #166,
27//!   length-1 `Vec<f32>` force action, 2-dim `[position, velocity]`
28//!   observation, real terminal state at the goal)
29//! - BucketBrigade (feature `env-bucket-brigade`): Slepian-Wolf MARL research
30//!   env wrapping `bucket_brigade_core` with the versioned scenario registry
31//!   from bucket-brigade PR #379
32//! - MatchingPennies (feature `training`): 2-agent zero-sum smoke env
33//!   implementing `JointEnv` for the multi-agent + PSRO trainers; canonical
34//!   testbed for mixed-equilibrium learners (issue #107).
35//! - NPlayerMatchingPennies (feature `training`): N-player "majority game"
36//!   generalization. Each agent's reward is `+1` if its action matches the
37//!   strict majority of *other* agents' actions, `-1` if against, `0` on tie
38//!   (odd N only). Smoke env for N-player PSRO/NFSP testing (issue #119).
39
40pub mod cartpole;
41pub mod continuous_lqr;
42pub mod flickering_cartpole;
43pub mod grid_world;
44pub mod masked_cartpole;
45#[cfg(feature = "training")]
46pub mod matching_pennies;
47pub mod mountain_car_continuous;
48#[cfg(feature = "training")]
49pub mod n_player_matching_pennies;
50pub mod pendulum;
51pub mod pong;
52#[cfg(feature = "training")]
53pub mod signaling;
54pub mod simple_bandit;
55pub mod snake;
56
57#[cfg(feature = "env-bucket-brigade")]
58pub mod bucket_brigade;
59
60// Re-export main types for convenience
61#[cfg(feature = "env-bucket-brigade")]
62pub use bucket_brigade::BucketBrigadeMaEnv;
63pub use cartpole::CartPole;
64pub use continuous_lqr::ContinuousLqr;
65pub use flickering_cartpole::FlickeringCartPole;
66pub use grid_world::GridWorld;
67pub use masked_cartpole::MaskedCartPole;
68#[cfg(feature = "training")]
69pub use matching_pennies::MatchingPennies;
70pub use mountain_car_continuous::MountainCarContinuous;
71#[cfg(feature = "training")]
72pub use n_player_matching_pennies::NPlayerMatchingPennies;
73pub use pendulum::PendulumSwingUp;
74pub use pong::Pong;
75#[cfg(feature = "training")]
76pub use signaling::SignalingGame;
77pub use simple_bandit::SimpleBandit;
78pub use snake::SnakeEnv;