Thanks to visit codestin.com
Credit goes to github.com

Skip to content

A Reinforcement Learning Agent for Jaipur — A custom Gymnasium environment and self-play training pipeline for mastering the strategic 2-player card game Jaipur, using a milti-input, multi-output (MIMO) PPO agent with Stable-Baselines3 and sb3-plus

nicholasg1997/jAIpur

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jAIpur

jAIpur is a reinforcement learning (RL) environment and research toolkit for the board game Jaipur. It features a custom OpenAI Gymnasium-compatible environment, Stable Baselines3-style agent training (with MIMO support via @adysonmaia/sb3-plus), and is organized for future agent evaluation and human play.


Features

  • Jaipur Gym Environment:
    Implements all rules, tokens, and actions for Jaipur with multi-discrete action spaces and rich observations.
  • Agent Training:
    Train agents using Stable Baselines3-style APIs and sb3-plus for multi-output (MIMO) policy support.
    Training is highly configurable via YAML config files.
  • Extensible:
    Designed for easy addition of:
    • Agent-vs-agent or self-play evaluation scripts (coming soon)
    • Human-vs-agent CLI or GUI play (coming soon)

Installation

  1. Clone this repository:

    git clone https://github.com/nicholasg1997/jAIpur.git
    cd jAIpur
  2. Install dependencies:

    pip install -r requirements.txt

Configuration

  • All core environment and game rules are defined in the configs/ folder.
  • The default RL hyperparameters are set in configs/ppo_configs.yaml.
  • You can specify a different config directory at runtime to override defaults.

Usage

Training an Agent

To train an agent with the default configuration:

python scripts/train_agent.py
  • The training script loads the default config from configs/ppo_configs.yaml.
  • To use a custom config, pass the directory or file location as an argument (see script for details).

Trained models are saved to the models/ directory by default.

Evaluation & Play (Coming Soon)

  • Test Agent vs. Itself:
    Scripts to evaluate a trained agent against itself or other agents are coming soon.
  • Play Against the Agent:
    Play Jaipur against your trained agent via CLI or GUI (in development).

Project Structure

jaipur_rl/
  envs/         # Gymnasium environment
  game/         # Jaipur game logic
  training/     # Training utilities, callbacks, schedulers, trainer
configs/        # Game and RL configs (ppo_configs.yaml, game_configs.py, etc)
scripts/        # Training entry points
models/         # Saved agents

Acknowledgements


Questions, suggestions, or want to contribute?
Open an issue or pull request on GitHub!

About

A Reinforcement Learning Agent for Jaipur — A custom Gymnasium environment and self-play training pipeline for mastering the strategic 2-player card game Jaipur, using a milti-input, multi-output (MIMO) PPO agent with Stable-Baselines3 and sb3-plus

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages