Skip to content

kalitsos/Tichu-1

 
 

Repository files navigation

Tichu

Implementation of the Tichu game and agents able to play it.


Dependencies

Python 3.6+

And following packages (all should be installable with pip or anaconda).

Then do (to register the gym-environment):

cd gym-tichu
pip install -e .

Play a game

Gamelogs are written to the folder Tichu/logs

To play a game against three agents:

python play.py

To play a game against three agents and see all cards.

python play.py --cheat

To watch a game amongst four agents:

python play.py --lazy

More games can be found in the game_starter.py

Train a Deep-Q-learning agent

Training results are written to the folder nn_training/logs

Example (train against random agents for 10000 steps (10000 decisions taken by the agent)):

python nn_training/train_dqn.py dqn_2l17x5_2_sep random 10000

Following command shows all options

python nn_training/train_dqn.py -h

To visualize the training afterwards:

python nn_training/visualize_logs.py nn_training/logs/**/*.json

To save the plots:

python nn_training/visualize_logs.py nn_training/logs/**/*.json --save

Run Experiments / Tournaments

Experiment results are written to the folder experiments/logs.

Launch the experiments/run_experiments.py script.

For example, to launch a Tournament between the 4 DQN-agents, each game lasts until one team reached 1000 points, do:

python experiments/run_experiments.py nn_tournament --target 1000

To list all options:

python experiments/run_experiments.py -h

About

Implementation of the Tichu game for a semester-project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 75.4%
  • Python 24.6%