fionaxc / alphaDOM

5 stars 0 forks source link

AlphaDOM

AlphaDOM is a project focused on building a Deep Reinforcement Learning AI to play Dominion! Dominion is a deck-building card game where players compete to accumulate the most victory points by purchasing cards from a shared supply and strategically building their personal decks to optimize their actions, buys, and overall strategy.

Agents

Repository Structure

The repository is generally organized as follows:

Play Testing

Play against any of our sample agents by running the following from the root directory:

python3 src/play.py

Running the Training Process

  1. Create a virtual environment:

    python3 -m venv alphaDOM_env
  2. Activate the virtual environment:

    source alphaDOM_env/bin/activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. To run the main training process, use the following command from the root directory of the project:

    python3 src/main.py [arguments]
  5. Results will be saved to the src/output directory!

Command-line Arguments

The script accepts the following command-line arguments:

Argument Type Default Description
--num_games int 1000000 Number of games to train
--batch_size int 32 Batch size (in games) for training
--update_epochs int 5 Number of epochs for each update
--hidden_size int 256 Hidden size of the neural network
--run_id str "default_run" Unique identifier for this run
--checkpoint_path str None Path to a checkpoint file to load model weights from

Running Unit Tests

To ensure the game engine is functioning correctly, we have included a suite of unit tests:

python3 -m unittest discover -s tests

Or if you want to run a specific test, you can do something like:

python3 -m unittest tests.test_game_engine.TestGameEngine.test_merchant_card