This project implements a reinforcement learning agent using Deep Q-Learning to navigate a simulated hospital environment. The agent, representing a nurse assistant, must efficiently navigate a 5x5 grid to reach a medicine cabinet while avoiding collisions with doctors and nurses.
- 5x5 grid representing a hospital floor
- Agent: Nurse assistant (🙂)
- Static objects: 5 Beds, 1 Medicine Cabinet, 1 Doctor, 1 Nurse
- Actions: Move Up, Down, Left, Right
- Rewards:
- Reaching Medicine Cabinet: +10
- Reaching a Bed: +1
- Colliding with Doctor or Nurse: -5
- Each step: -0.1 (to encourage efficiency)
- Termination Conditions:
- Reaching the Medicine Cabinet (success)
- Colliding with Doctor or Nurse (failure)
- Max steps reached (100 steps)
HospitalNavigation_env.py
: Custom Gym environment implementationtrain.py
: Script to train the DQN agentplay.py
: Script to run simulations with the trained agenthospital_navigation_weights.h5f
: Saved weights of the trained modelrequirements.txt
: List of required Python packages
- Clone this repository:
git clone https://github.com/freedisch/DQN.git
cd DQN
- Install the required packages:
pip install -r requirements.txt
- To train the agent:
python train.py
- To run a simulation with the trained agent:
python play.py
Link to 5-minute video demonstration
- Python 3.8+
- OpenAI Gym
- Keras
- Keras-RL
- TensorFlow
Thibaut Batale
This project is licensed under the MIT License - see the LICENSE file for details.