A cart pole balancing agent powered by Q-Learning. Uses Python 3 and Gymnasium (formerly OpenAI Gym).
This project uses Poetry for managing Python packages and tools. Please install it first.
Then install the dependencies using:
$ poetry install --without dev --no-root
To run the environment in verbose mode (with rendering, plotting, and detailed logging), run:
$ poetry shell
$ python run.py --verbose
To run in performance mode (no visualizations, only basic logging), run:
$ poetry shell
$ python run.py
Episode statistics will be available in experiment-results/episode_history.csv
.
You may need to install the TkAgg
backend support for matplotlib in order for the GUI window to show up properly. For example:
$ sudo apt install python3.10-tk
Install the development dependencies:
$ poetry install --with dev --no-root
Install pre-commit hooks (recommended):
$ pre-commit install
Run unit tests:
$ pytest .