/Agent-Decision-Making

The assignment for SC4003-CE4046-CZ4046-INTELLIGENT AGENTS focuses on Agent Decision Making, specifically in the context of a maze environment.

Primary LanguagePythonMIT LicenseMIT

Maze Solver: Intelligent Agents Assignment 1

Python Tests

logo

Overview

This project is the first assignment for the SC4003-CE4046-CZ4046-INTELLIGENT AGENTS course. It involves implementing value iteration and policy iteration algorithms to solve a maze environment. The goal is to find the optimal policy and utilities for all non-wall states in the maze.

Results

The following section presents the results of the maze solver algorithm, showcasing the original maze configuration and the optimized policy obtained after running the algorithm.

Original Maze

The original maze is set up with walls, positive rewards, and negative rewards as shown below:

Original Maze

Optimized Policy

After running the maze solver algorithm, the optimized policy indicating the best actions at each state is visualized below:

Value iteration policy and utility:

Policy Utility
Value Iteration Policy Value Iteration Utility

Policy iteration policy and utility:

Policy Utility
Policy Iteration Policy Policy Iteration Utility

The arrows represent the direction of the optimal action to take from each non-wall grid cell. Green cells indicate positive rewards, orange cells indicate negative rewards, and gray cells represent walls. The optimized policy provides a guide for an agent to maximize rewards and reach the goal state efficiently.

The results denote both could converge to the same state.

For more details please check the report

Getting Started

Installation

  1. Clone the repository:

    git clone https://github.com/H-tr/Agent-Decision-Making.git
  2. Navigate to the project directory:

    cd Agent-Decision-Making

Usage

  1. Create the python environment

    conda create -n maze_solver python=3.10 -y
    conda activate maze_solver
    pip install -r requirements.txt
  2. Run the main logic

    To monitor the iteration progress

    tensorboard --logdir=runs
    python main.py

    For part 2:

    python main.py --assignment part_2
  3. Test

    python -m unittest tests.test_maze_solver

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Course instructors and teaching assistants for providing guidance and support.