This project implements a reinforcement learning agent to solve the Frozen Lake environment from OpenAI Gym. It uses value iteration to find the optimal policy.
- Clone the repository:
git clone https://github.com/wuhungmao/frozen_lake.git - Navigate to the project directory:
cd frozen-lake-solver - Create a virtual environment (recommended):
python3 -m venv .venv - Activate the virtual environment:
source .venv/bin/activate(Linux/macOS) or.venv\Scripts\activate(Windows) - Install the required dependencies:
pip install -r requirements.txt
main.py: The main script that runs the value iteration algorithm and extracts the policy.frozen_lake.py: Contains the implementation of the Frozen Lake environment wrapper and the value iteration algorithm.test_frozen_lake.py: Contains the unit tests for the code.requirements.txt: Lists the project's dependencies (gym, numpy, etc.).
To run the main program:
python3 main.py --map_size 8 --is_slippery