Machine Learning Engineer Nanodegree
Reinforcement Learning
Project: Train a Smartcab How to Drive
Taxicabs are operated by self-driving agents — known as smartcabs — to transport people from one location to another within the cities those companies operate using Q-Learning Algorithm. In this project, I achieved 97 success to reach the destination out of 100 trials.
Install
This project requires Python 2.7 with the pygame library installed
Code
Template code is provided in the smartcab/agent.py python file. Additional supporting python code can be found in smartcab/enviroment.py, smartcab/planner.py, and smartcab/simulator.py. Supporting images for the graphical user interface can be found in the images folder. While some code has already been implemented to get you started, you will need to implement additional functionality for the LearningAgent class in agent.py when requested to successfully complete the project.
Run
In a terminal or command window, navigate to the top-level project directory smartcab/ (that contains this README) and run one of the following commands:
1) - As for the execute basic agent1 to random action
- change to the directory 'basic_agent' then excute following line.
python smartcab/agent1.py
python -m smartcab.agent12) - As for the execute basic agent2 to simple planner - change to the directory 'basic_agent' then excute following line.
python smartcab/agent2.py
python -m smartcab.agent23) - As for the execute agent.py to Q learning agent - change to the directory 'qlearning_agent' then excute following line.
python smartcab/agent.py
python -m smartcab.agent
This will run the agent.py file and execute your agent code.